1
0
mirror of https://github.com/etesync/server synced 2024-12-29 10:48:07 +00:00

Item deps: fix.

This commit is contained in:
Tom Hacohen 2020-05-19 11:44:20 +03:00
parent 775f438e61
commit 306e7dcd11

View File

@ -163,9 +163,8 @@ class CollectionItemDepSerializer(serializers.ModelSerializer):
fields = ('uid', 'stoken')
def validate(self, data):
for item_data in data:
item = self.__class__.Meta.model.objects.get(uid=item_data['uid'])
stoken = item_data['stoken']
item = self.__class__.Meta.model.objects.get(uid=data['uid'])
stoken = data['stoken']
if item.stoken != stoken:
raise serializers.ValidationError('Wrong stoken. Expected {} got {}'.format(item.stoken, stoken))