Details
-
Type: Bug
-
Status: Resolved
-
Priority: 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.
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
- All
- Comments
- History
- Activity
- Transitions
- Commits