misc: increase djangorestframework version limit (#49537)

This commit is contained in:
Valentin Deniaud 2020-12-16 13:51:48 +01:00
parent b44da82e3b
commit 41f53ebd1a
3 changed files with 5 additions and 5 deletions

View File

@ -223,8 +223,8 @@ class ValidationAPI(CommonAPIMixin,
return super(ValidationAPI, self).get_queryset().filter(document_type=self.document_type)
def initial(self, request, document_type, *args, **kwargs):
self.schema = utils.get_document_type_schema(settings, document_type)
if not self.schema:
self.document_type_schema = utils.get_document_type_schema(settings, document_type)
if not self.document_type_schema:
error = serializers.ValidationError('unknown document type')
error.status_code = status.HTTP_404_NOT_FOUND
raise error
@ -233,7 +233,7 @@ class ValidationAPI(CommonAPIMixin,
def get_serializer(self, *args, **kwargs):
# pass schema to serializer class
return super(ValidationAPI, self).get_serializer(schema=self.schema, *args, **kwargs)
return super(ValidationAPI, self).get_serializer(schema=self.document_type_schema, *args, **kwargs)
router = routers.SimpleRouter()
router.register(r'validation/(?P<document_type>[^/]*)', ValidationAPI,

View File

@ -1,5 +1,5 @@
django>=1.7,<1.9
django-tables2<1.1
django-jsonfield >= 0.9.3
djangorestframework>=3.3,<3.4
djangorestframework>=3.3,<3.10
file-magic

View File

@ -112,7 +112,7 @@ setup(
'django-tables2>=1.5,<2.0',
'django-jsonfield >= 0.9.3',
'django-filter>1,<2.2',
'djangorestframework>=3.4,<3.8',
'djangorestframework>=3.4,<3.10',
'file-magic',
'requests',
'sorl-thumbnail',