Commit 6e42094b authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes creating a document through the api not settings the owner, #295.

parent 1abf223d
......@@ -70,6 +70,9 @@ class DocumentViewSet(ModelViewSet):
def form_error(self, msg):
return Response({'status': 'error', 'error': msg}, status=400)
def perform_create(self, serializer):
serializer.save(owner=self.request.user)
@action(detail=True, methods=['post'])
def imports(self, request, pk=None):
document = self.get_object()
......
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