mirror of https://gitlab.crans.org/bde/nk20
[WEI] Fix some issues
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
a2a749e1ca
commit
f25eb1d2c5
|
@ -40,6 +40,7 @@ class WEISurveyForm2021(forms.Form):
|
||||||
if not information.seed:
|
if not information.seed:
|
||||||
information.seed = int(1000 * time.time())
|
information.seed = int(1000 * time.time())
|
||||||
information.save(registration)
|
information.save(registration)
|
||||||
|
registration._force_save = True
|
||||||
registration.save()
|
registration.save()
|
||||||
|
|
||||||
rng = Random(information.seed)
|
rng = Random(information.seed)
|
||||||
|
|
|
@ -487,9 +487,13 @@ class WEIRegister1AView(ProtectQuerysetMixin, ProtectedCreateView):
|
||||||
|
|
||||||
def get_sample_object(self):
|
def get_sample_object(self):
|
||||||
wei = WEIClub.objects.get(pk=self.kwargs["wei_pk"])
|
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(
|
return WEIRegistration(
|
||||||
wei=wei,
|
wei=wei,
|
||||||
user=User.objects.get(username="note"),
|
user=user,
|
||||||
first_year=True,
|
first_year=True,
|
||||||
birth_date="1970-01-01",
|
birth_date="1970-01-01",
|
||||||
gender="No",
|
gender="No",
|
||||||
|
@ -555,9 +559,13 @@ class WEIRegister2AView(ProtectQuerysetMixin, ProtectedCreateView):
|
||||||
|
|
||||||
def get_sample_object(self):
|
def get_sample_object(self):
|
||||||
wei = WEIClub.objects.get(pk=self.kwargs["wei_pk"])
|
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(
|
return WEIRegistration(
|
||||||
wei=wei,
|
wei=wei,
|
||||||
user=User.objects.get(username="note"),
|
user=user,
|
||||||
first_year=True,
|
first_year=True,
|
||||||
birth_date="1970-01-01",
|
birth_date="1970-01-01",
|
||||||
gender="No",
|
gender="No",
|
||||||
|
|
Loading…
Reference in New Issue