From e851fb98776ddb3025111cbaa315d64c025fbb2b Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 19 May 2020 15:28:20 +0300 Subject: [PATCH] Views: fix wrong items name. --- django_etesync/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_etesync/views.py b/django_etesync/views.py index ad57d28..9d5d938 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -268,14 +268,14 @@ class CollectionItemViewSet(BaseViewSet): if ser_valid and deps_ser_valid: try: with transaction.atomic(): - collections = serializer.save(collection=collection_object) + items = serializer.save(collection=collection_object) except IntegrityError: # FIXME: should return the items with a bad token (including deps) so we don't have to fetch them after content = {'code': 'integrity_error'} return Response(content, status=status.HTTP_400_BAD_REQUEST) ret = { - "data": [collection.stoken for collection in collections], + "data": [item.stoken for item in items], } return Response(ret, status=status.HTTP_200_OK)