Skip to content
Snippets Groups Projects
Verified Commit f25eb1d2 authored by ynerant's avatar ynerant
Browse files

[WEI] Fix some issues


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent a2a749e1
No related branches found
No related tags found
1 merge request!175Amélirations questionnaire WEI
Pipeline #9038 failed with stages
in 15 minutes and 1 second
......@@ -40,6 +40,7 @@ class WEISurveyForm2021(forms.Form):
if not information.seed:
information.seed = int(1000 * time.time())
information.save(registration)
registration._force_save = True
registration.save()
rng = Random(information.seed)
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment