Details
-
Type: Bug
-
Status: Reopened
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: Current Version
-
Fix Version/s: None
-
Component/s: OIOIOI
-
Labels:None
Description
Sometimes when a teacher is adding a contest, the contest is created with an empty `controller_name`, which causes `controller` to be None, which causes tons of AttributeErrors on 2/3 of pages, including the main portal / landing page.
Stacktrace from a sanity check I added to diagnose this issue:
https://sentry.io/the-sio2-project/szkopul/issues/351545304/
{code}
ValueError: Tried to save contest with empty controller
File "oioioi/contests/models.py", line 79, in save
raise ValueError("Tried to save contest with empty controller")
File "oioioi/contests/forms.py", line 76, in save
instance.save()
File "oioioi/base/admin.py", line 333, in add_view
return model_admin.add_view(request, form_url, extra_context)
...
(12 additional frame(s) were not displayed)
ValueError: Tried to save contest with empty controller
{code}
Probable cause:
If there are no rounds specified, this code saves the contest even if it's not supposed to (commit=False):
https://github.com/sio2project/oioioi/blob/master/oioioi/contests/forms.py#L73-L82
Git blame suggests it's been there since the very beginning, I have on idea why this issue didn't appear before.
Stacktrace from a sanity check I added to diagnose this issue:
https://sentry.io/the-sio2-project/szkopul/issues/351545304/
{code}
ValueError: Tried to save contest with empty controller
File "oioioi/contests/models.py", line 79, in save
raise ValueError("Tried to save contest with empty controller")
File "oioioi/contests/forms.py", line 76, in save
instance.save()
File "oioioi/base/admin.py", line 333, in add_view
return model_admin.add_view(request, form_url, extra_context)
...
(12 additional frame(s) were not displayed)
ValueError: Tried to save contest with empty controller
{code}
Probable cause:
If there are no rounds specified, this code saves the contest even if it's not supposed to (commit=False):
https://github.com/sio2project/oioioi/blob/master/oioioi/contests/forms.py#L73-L82
Git blame suggests it's been there since the very beginning, I have on idea why this issue didn't appear before.
Activity
- All
- Comments
- History
- Activity
- Transitions
- Commits
Wojciech Dubiel
made changes -
Field | Original Value | New Value |
---|---|---|
Reporter | Sentry [ sentry ] | Wojciech Dubiel [ wolf480 ] |
Szymon Acedański
made changes -
Status | New [ 10000 ] | Resolved [ 5 ] |
Assignee | Szymon Acedański [ accek ] | |
Resolution | Fixed [ 1 ] |
Wojciech Dubiel
made changes -
Resolution | Fixed [ 1 ] | |
Status | Resolved [ 5 ] | Reopened [ 4 ] |
Wojciech Dubiel
made changes -
Priority | Critical [ 2 ] | Major [ 3 ] |
Szymon Acedański
made changes -
Status | Reopened [ 4 ] | Resolved [ 5 ] |
Resolution | Obsolete [ 7 ] |
Wojciech Dubiel
made changes -
Resolution | Obsolete [ 7 ] | |
Status | Resolved [ 5 ] | Reopened [ 4 ] |