From 0bfc3b945481bb6c5b186d71abb843c6eb6d5028 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 28 Jul 2020 18:09:43 +0200 Subject: [PATCH] Not-yet-registered WEI members can see their registrations --- apps/permission/fixtures/initial.json | 26 ++++++++++++++++---------- apps/scripts | 1 - apps/wei/views.py | 2 ++ 3 files changed, 18 insertions(+), 11 deletions(-) delete mode 160000 apps/scripts diff --git a/apps/permission/fixtures/initial.json b/apps/permission/fixtures/initial.json index a426ab89..79311eb9 100644 --- a/apps/permission/fixtures/initial.json +++ b/apps/permission/fixtures/initial.json @@ -2094,8 +2094,6 @@ 39, 40, 70, - 108, - 109, 14, 15, 16, @@ -2103,7 +2101,15 @@ 18, 78, 79, - 83 + 83, + 90, + 93, + 95, + 97, + 99, + 101, + 108, + 109 ] } }, @@ -2493,18 +2499,18 @@ "for_club": null, "name": "Adhérent WEI", "permissions": [ - 97, - 99, - 101, - 108, 77, - 109, - 114, 84, 87, 90, 93, - 95 + 95, + 97, + 99, + 101, + 108, + 109, + 114 ] } }, diff --git a/apps/scripts b/apps/scripts deleted file mode 160000 index fc29147c..00000000 --- a/apps/scripts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fc29147c876c33d4cf41a86d46d736ff69d176ff diff --git a/apps/wei/views.py b/apps/wei/views.py index 3accb804..be73370f 100644 --- a/apps/wei/views.py +++ b/apps/wei/views.py @@ -132,6 +132,7 @@ class WEIDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): else: # Check if the user has the right to create a registration of a random first year member. empty_fy_registration = WEIRegistration( + wei=club, user=random_user, first_year=True, birth_date="1970-01-01", @@ -144,6 +145,7 @@ class WEIDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): # Check if the user has the right to create a registration of a random old member. empty_old_registration = WEIRegistration( + wei=club, user=User.objects.filter(~Q(wei__wei__in=[club])).first(), first_year=False, birth_date="1970-01-01",