CartPosition API: Fix setting a custom cart ID

This commit is contained in:
Raphael Michel
2020-12-01 17:06:03 +01:00
parent eed309636f
commit 242bfc0023

View File

@@ -107,6 +107,7 @@ class CartPositionCreateSerializer(I18nAwareModelSerializer):
def validate_cart_id(self, cid): def validate_cart_id(self, cid):
if cid and not cid.endswith('@api'): if cid and not cid.endswith('@api'):
raise ValidationError('Cart ID should end in @api or be empty.') raise ValidationError('Cart ID should end in @api or be empty.')
return cid
def validate_item(self, item): def validate_item(self, item):
if item.event != self.context['event']: if item.event != self.context['event']: