diff --git a/tildes/tildes/models/group/group_wiki_page.py b/tildes/tildes/models/group/group_wiki_page.py index 2eddce3..d369083 100644 --- a/tildes/tildes/models/group/group_wiki_page.py +++ b/tildes/tildes/models/group/group_wiki_page.py @@ -68,7 +68,7 @@ class GroupWikiPage(DatabaseModel): # create the directory for the group if it doesn't already exist self.file_path.parent.mkdir(mode=0o755, exist_ok=True) - self.edit(markdown, user, f'~{group.path}: Create page "{page_name}"') + self.edit(markdown, user, "Create page") def __acl__(self) -> Sequence[Tuple[str, Any, str]]: """Pyramid security ACL.""" @@ -140,6 +140,10 @@ class GroupWikiPage(DatabaseModel): repo.index.add(str(self.file_path.relative_to(self.BASE_PATH))) repo.index.write() + # Prepend the group name and page slug to the edit message - if you change the + # format of this, make sure to also change the page-editing template to match + edit_message = f"~{self.group.path}/{self.slug}: {edit_message}" + repo.create_commit( repo.head.name, author, diff --git a/tildes/tildes/templates/group_wiki_edit_page.jinja2 b/tildes/tildes/templates/group_wiki_edit_page.jinja2 index d81e687..daeef2a 100644 --- a/tildes/tildes/templates/group_wiki_edit_page.jinja2 +++ b/tildes/tildes/templates/group_wiki_edit_page.jinja2 @@ -30,7 +30,10 @@
- +
+ ~{{ page.group.path }}/{{ page.slug }}: + +