Browse Source

Add type hinting and simple code documentation to create method on

batch create mixin
master
Alireza Savand 1 year ago
parent
commit
3b435aeb23
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      api/views.py

+ 2
- 1
api/views.py View File

@@ -28,7 +28,8 @@ class BatchCreateMixin:

return Response(created_data, status=status.HTTP_201_CREATED)

def create(self, request, *args, **kwargs):
def create(self, request: Request, *args, **kwargs) -> Response:
"""Override to handle `batch` requests."""
if 'batch' in request.data and isinstance(request.data['batch'], list):
return self.batch_create(request.data['batch'])


Loading…
Cancel
Save