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