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"
`adjust_preferences_factory_fields` adds field, that uses `user` to get default view. Then `RegistrationView` generates form using `PreferenceFactory` with `user` set to `None`.
Possible fix:
Lambda added in adjust_preferences_factory_fields can test is User is None. This fixes the problem, but `RegistrationView` now may or may not has preferences fields. Additionally preferences fields visible in registration form have will have no effect. To fix this `adjust_preferences_factory_fields`+`handle_new_preference_fields` logic should be added to `RegistrationView`.
`Adjust_preferences_factory_fields` could be called once in same way `_maybe_add_field` is called, but I'm not sure if it will always work.