Commit 3f5a2e14 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

bugfix: do not filter auto_autor on options requests !190

parent e6bb7b4f
Pipeline #6263 passed with stage
in 1 minute and 22 seconds
...@@ -255,7 +255,7 @@ class LDPSerializer(HyperlinkedModelSerializer): ...@@ -255,7 +255,7 @@ class LDPSerializer(HyperlinkedModelSerializer):
fields = list(self.Meta.model._meta.serializer_fields) fields = list(self.Meta.model._meta.serializer_fields)
except AttributeError: except AttributeError:
fields = super().get_default_field_names(declared_fields, model_info) fields = super().get_default_field_names(declared_fields, model_info)
if 'request' in self._context and not self._context['request']._request.method == 'GET': if 'request' in self._context and not (self._context['request']._request.method == 'GET' or self._context['request']._request.method == 'OPTIONS'):
try: try:
fields.remove(self.Meta.model._meta.auto_author) fields.remove(self.Meta.model._meta.auto_author)
except ValueError: except ValueError:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment