API: Fix event cloning, limit_sales_channels should never be set when all_sales_channels is set (Z#23169537)

This commit is contained in:
Raphael Michel
2024-10-23 16:29:33 +02:00
parent 22c36b89da
commit 19175258fd
3 changed files with 7 additions and 2 deletions

View File

@@ -110,6 +110,10 @@ class SalesChannelMigrationMixin:
data["all_sales_channels"] = False
data["limit_sales_channels"] = data["sales_channels"]
del data["sales_channels"]
if data.get("all_sales_channels"):
data["limit_sales_channels"] = []
return super().to_internal_value(data)
def to_representation(self, value):