[WEI] Fix some issues

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-09-05 17:30:59 +02:00
parent a2a749e1ca
commit f25eb1d2c5
No known key found for this signature in database
GPG key ID: 3A75C55819C8CF85
2 changed files with 11 additions and 2 deletions

View file

@ -487,9 +487,13 @@ class WEIRegister1AView(ProtectQuerysetMixin, ProtectedCreateView):
def get_sample_object(self):
wei = WEIClub.objects.get(pk=self.kwargs["wei_pk"])
if "myself" in self.request.path:
user = self.request.user
else:
user = User.objects.get(username="note")
return WEIRegistration(
wei=wei,
user=User.objects.get(username="note"),
user=user,
first_year=True,
birth_date="1970-01-01",
gender="No",
@ -555,9 +559,13 @@ class WEIRegister2AView(ProtectQuerysetMixin, ProtectedCreateView):
def get_sample_object(self):
wei = WEIClub.objects.get(pk=self.kwargs["wei_pk"])
if "myself" in self.request.path:
user = self.request.user
else:
user = User.objects.get(username="note")
return WEIRegistration(
wei=wei,
user=User.objects.get(username="note"),
user=user,
first_year=True,
birth_date="1970-01-01",
gender="No",