Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-09-05 19:32:34 +02:00
parent bb69627ac5
commit e5051ab018
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 4 additions and 4 deletions

View File

@ -492,8 +492,8 @@ class WEIRegister1AView(ProtectQuerysetMixin, ProtectedCreateView):
else: else:
# To avoid unique validation issues, we use an account that can't join the WEI. # To avoid unique validation issues, we use an account that can't join the WEI.
# In development mode, the note account may not exist, we use a random user (may fail) # In development mode, the note account may not exist, we use a random user (may fail)
user = User.objects.get(username="note") if User.objects.filter(username="note").exists() \ user = User.objects.get(username="note") \
else User.objects.first() if User.objects.filter(username="note").exists() else User.objects.first()
return WEIRegistration( return WEIRegistration(
wei=wei, wei=wei,
user=user, user=user,
@ -567,8 +567,8 @@ class WEIRegister2AView(ProtectQuerysetMixin, ProtectedCreateView):
else: else:
# To avoid unique validation issues, we use an account that can't join the WEI. # To avoid unique validation issues, we use an account that can't join the WEI.
# In development mode, the note account may not exist, we use a random user (may fail) # In development mode, the note account may not exist, we use a random user (may fail)
user = User.objects.get(username="note") if User.objects.filter(username="note").exists() \ user = User.objects.get(username="note") \
else User.objects.first() if User.objects.filter(username="note").exists() else User.objects.first()
return WEIRegistration( return WEIRegistration(
wei=wei, wei=wei,
user=user, user=user,