Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: TAG 2021/22 Summer Sprint 1
    • Fix Version/s: None
    • Component/s: OIOIOI
    • Labels:
      None

      Description

      Page /api/docs page returns error 500:

      AttributeError at /api/docs/

      'AutoSchema' object has no attribute 'get_link'

      Request Method: GET
      Request URL: http://localhost:8000/api/docs/
      Django Version: 3.1.14
      Exception Type: AttributeError
      Exception Value:

      'AutoSchema' object has no attribute 'get_link'

      Exception Location: /home/oioioi/.local/lib/python3.7/site-packages/rest_framework/schemas/coreapi.py, line 143, in get_links
      Python Executable: /usr/bin/python3
      Python Version: 3.7.3
      Python Path:

      ['/sio2/deployment',
       '/sio2/deployment',
       '/sio2/deployment',
       '/sio2/deployment',
       '/sio2/deployment',
       '/usr/lib/python37.zip',
       '/usr/lib/python3.7',
       '/usr/lib/python3.7/lib-dynload',
       '/home/oioioi/.local/lib/python3.7/site-packages',
       '/sio2/oioioi',
       '/usr/local/lib/python3.7/dist-packages',
       '/usr/lib/python3/dist-packages']

      Server time: Tue, 29 Mar 2022 18:54:32 +0000



      Some background:
      https://stackoverflow.com/questions/57654243/how-to-fix-attributeerror-at-api-doc-autoschema-object-has-no-attribute-ge

      Fix:
      ---
      diff --git a/oioioi/default_settings.py b/oioioi/default_settings.py
      index 9f26d52c..35ecf6a7 100755
      --- a/oioioi/default_settings.py
      +++ b/oioioi/default_settings.py
      @@ -670,7 +670,8 @@ REST_FRAMEWORK = {
           'DEFAULT_AUTHENTICATION_CLASSES': (
               'rest_framework.authentication.TokenAuthentication',
               'rest_framework.authentication.SessionAuthentication',
      - )
      + ),
      + 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'
       }
       
       ARCHIVE_USERCONTESTS = False
      ---

      Also regression tests should be added.

        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:
            Tomasz Waleń
            Reporter:
            Tomek Waleń
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: