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

        Connect your code to JIRA

        Link every code change to JIRA just by adding an issue keys in commit messages. Bridge the gap back to your source and know which changes fixed which JIRA issues.

        Git & Mercurial in the cloud

        Collaborate across unlimited private code repositories.

        Git behind the firewall

        Manage and collaborate on Git repositories behind a firewall.

        Browse and search code

        Browse, search, and track source code repositories.

          People

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

            Dates

            • Created:
              Updated: