From 181f2ecc1518caac1ccd9a5bf03a656fb40bea0a Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Wed, 16 Dec 2020 13:51:48 +0100 Subject: [PATCH] increase djangorestframework version limit --- fargo/fargo/api_views.py | 6 +++--- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fargo/fargo/api_views.py b/fargo/fargo/api_views.py index 222b44b..da6cae7 100644 --- a/fargo/fargo/api_views.py +++ b/fargo/fargo/api_views.py @@ -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[^/]*)', ValidationAPI, diff --git a/requirements.txt b/requirements.txt index 443819f..3b3aecc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index b954622..c5031a0 100755 --- a/setup.py +++ b/setup.py @@ -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', -- 2.20.1