Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: TAG 2021/22 Summer Sprint 1
-
Fix Version/s: Current Version
-
Component/s: OIOIOI
-
Labels:None
Description
In some rare occasions registration fails with 500 error (see attachment).
Go to szkopul:
1. Login
2. Logout
3. click "login"
4. enter fake data (non-existent user)
5. click "create new account"
Go to szkopul:
1. Login
2. Logout
3. click "login"
4. enter fake data (non-existent user)
5. click "create new account"
diff --git a/oioioi/base/views.py b/oioioi/base/views.py
index d5466e29..71819b6f 100644
--- a/oioioi/base/views.py
+++ b/oioioi/base/views.py
@@ -99,6 +99,8 @@ def adjust_preferences_factory_fields(request):
choices_not_translated = [("", "None")] + list(settings.LANGUAGES)
choices = [(k, _(v)) for k, v in choices_not_translated]
+ ensure_preferences_exist_for_user(request)
+
PreferencesFactory.add_field(
"preferred_language",
ChoiceField,