Skip to content

Commit

Permalink
Upgrade DRF to v3.7.7 and required changes to keep things running
Browse files Browse the repository at this point in the history
  • Loading branch information
jathanism committed Mar 7, 2018
1 parent 6e3bcb2 commit d528580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions nsot/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def bulk_update(self, request, *args, **kwargs):
it is only defined here.
Credit: https://github.com/miki725/django-rest-framework-bulk/issues/30
Source: http://bit.ly/2ilboIQ
Source: http://bit.ly/2HcyNnG
"""
partial = kwargs.pop('partial', False)

Expand All @@ -799,12 +799,14 @@ def bulk_update(self, request, *args, **kwargs):
data=item,
partial=partial,
)

item_serializer.root = serializer
if not item_serializer.is_valid():
validation_errors.append(item_serializer.errors)

validated_data.append(item_serializer.validated_data)
obj_data = item_serializer.validated_data
# By default validated_data does not have `id`, so adding it in
# validated_data of each item
obj_data['id'] = item['id']
validated_data.append(obj_data)

if validation_errors:
raise exc.ValidationError(validation_errors)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ django-guardian~=1.4.9
django-jinja~=2.4.1
django-macaddress~=1.4.1
django-rest-swagger~=0.3.5
djangorestframework~=3.5.0
djangorestframework~=3.7.7
djangorestframework-bulk~=0.2.1
drf-extensions~=0.3.1
drf-nested-routers~=0.11.1
Expand Down

0 comments on commit d528580

Please sign in to comment.