The SIO2 project
  1. The SIO2 project
  2. SIO-2020

Contests are sometimes created with empty controller_name

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Major 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.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        New New Resolved Resolved
        49d 18h 29m 1 Szymon Acedański 2017-11-8 13:53
        Reopened Reopened Resolved Resolved
        883d 1h 59m 1 Szymon Acedański 2020-04-27 16:28
        Resolved Resolved Reopened Reopened
        17d 23h 58m 2 Wojciech Dubiel 2020-04-27 16:51

          People

          • Assignee:
            Szymon Acedański
            Reporter:
            Wojciech Dubiel
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: