-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1020 from ae-utbm/taiste
RSS feed, subscription creation permisssion, pedagogy permissions and bugfixes
- Loading branch information
Showing
38 changed files
with
858 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,12 @@ def handle(self, *args, **options): | |
raise Exception("Never call this command in prod. Never.") | ||
|
||
Sith.objects.create(weekmail_destinations="[email protected] [email protected]") | ||
Site.objects.create(domain=settings.SITH_URL, name=settings.SITH_NAME) | ||
|
||
site = Site.objects.get_current() | ||
site.domain = settings.SITH_URL | ||
site.name = settings.SITH_NAME | ||
site.save() | ||
|
||
groups = self._create_groups() | ||
self._create_ban_groups() | ||
|
||
|
@@ -120,6 +125,11 @@ def handle(self, *args, **options): | |
unix_name=settings.SITH_MAIN_CLUB["unix_name"], | ||
address=settings.SITH_MAIN_CLUB["address"], | ||
) | ||
main_club.board_group.permissions.add( | ||
*Permission.objects.filter( | ||
codename__in=["view_subscription", "add_subscription"] | ||
) | ||
) | ||
bar_club = Club.objects.create( | ||
id=2, | ||
name=settings.SITH_BAR_MANAGER["name"], | ||
|
@@ -895,13 +905,16 @@ def _create_groups(self) -> PopulatedGroups: | |
|
||
subscribers = Group.objects.create(name="Subscribers") | ||
subscribers.permissions.add( | ||
*list(perms.filter(codename__in=["add_news", "add_uvcommentreport"])) | ||
*list(perms.filter(codename__in=["add_news", "add_uvcomment"])) | ||
) | ||
old_subscribers = Group.objects.create(name="Old subscribers") | ||
old_subscribers.permissions.add( | ||
*list( | ||
perms.filter( | ||
codename__in=[ | ||
"view_uv", | ||
"view_uvcomment", | ||
"add_uvcommentreport", | ||
"view_user", | ||
"view_picture", | ||
"view_album", | ||
|
@@ -973,9 +986,9 @@ def _create_groups(self) -> PopulatedGroups: | |
) | ||
pedagogy_admin.permissions.add( | ||
*list( | ||
perms.filter(content_type__app_label="pedagogy").values_list( | ||
"pk", flat=True | ||
) | ||
perms.filter(content_type__app_label="pedagogy") | ||
.exclude(codename__in=["change_uvcomment"]) | ||
.values_list("pk", flat=True) | ||
) | ||
) | ||
self.reset_index("core", "auth") | ||
|
Oops, something went wrong.