Allow sale of blocked seats on specific channels (#1518)

* Allow sale of blocked seats on specific channels

* Add docs
This commit is contained in:
Raphael Michel
2019-12-11 15:56:20 +01:00
committed by GitHub
parent 6d3ccc0182
commit 352942b7d6
10 changed files with 87 additions and 19 deletions

View File

@@ -778,7 +778,7 @@ class OrderCreateSerializer(I18nAwareModelSerializer):
errs[i]['seat'] = ['The specified seat does not exist.']
else:
pos_data['seat'] = seat
if (seat not in free_seats and not seat.is_available()) or seat in seats_seen:
if (seat not in free_seats and not seat.is_available(sales_channel=validated_data.get('sales_channel', 'web'))) or seat in seats_seen:
errs[i]['seat'] = [ugettext_lazy('The selected seat "{seat}" is not available.').format(seat=seat.name)]
seats_seen.add(seat)
elif seated: