misc: increase djangorestframework version limit (#49537)
This commit is contained in:
parent
b44da82e3b
commit
41f53ebd1a
|
@ -223,8 +223,8 @@ class ValidationAPI(CommonAPIMixin,
|
||||||
return super(ValidationAPI, self).get_queryset().filter(document_type=self.document_type)
|
return super(ValidationAPI, self).get_queryset().filter(document_type=self.document_type)
|
||||||
|
|
||||||
def initial(self, request, document_type, *args, **kwargs):
|
def initial(self, request, document_type, *args, **kwargs):
|
||||||
self.schema = utils.get_document_type_schema(settings, document_type)
|
self.document_type_schema = utils.get_document_type_schema(settings, document_type)
|
||||||
if not self.schema:
|
if not self.document_type_schema:
|
||||||
error = serializers.ValidationError('unknown document type')
|
error = serializers.ValidationError('unknown document type')
|
||||||
error.status_code = status.HTTP_404_NOT_FOUND
|
error.status_code = status.HTTP_404_NOT_FOUND
|
||||||
raise error
|
raise error
|
||||||
|
@ -233,7 +233,7 @@ class ValidationAPI(CommonAPIMixin,
|
||||||
|
|
||||||
def get_serializer(self, *args, **kwargs):
|
def get_serializer(self, *args, **kwargs):
|
||||||
# pass schema to serializer class
|
# 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 = routers.SimpleRouter()
|
||||||
router.register(r'validation/(?P<document_type>[^/]*)', ValidationAPI,
|
router.register(r'validation/(?P<document_type>[^/]*)', ValidationAPI,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
django>=1.7,<1.9
|
django>=1.7,<1.9
|
||||||
django-tables2<1.1
|
django-tables2<1.1
|
||||||
django-jsonfield >= 0.9.3
|
django-jsonfield >= 0.9.3
|
||||||
djangorestframework>=3.3,<3.4
|
djangorestframework>=3.3,<3.10
|
||||||
file-magic
|
file-magic
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -112,7 +112,7 @@ setup(
|
||||||
'django-tables2>=1.5,<2.0',
|
'django-tables2>=1.5,<2.0',
|
||||||
'django-jsonfield >= 0.9.3',
|
'django-jsonfield >= 0.9.3',
|
||||||
'django-filter>1,<2.2',
|
'django-filter>1,<2.2',
|
||||||
'djangorestframework>=3.4,<3.8',
|
'djangorestframework>=3.4,<3.10',
|
||||||
'file-magic',
|
'file-magic',
|
||||||
'requests',
|
'requests',
|
||||||
'sorl-thumbnail',
|
'sorl-thumbnail',
|
||||||
|
|
Loading…
Reference in New Issue