mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Fixed a logic bug
This commit is contained in:
@@ -106,7 +106,7 @@ def check_positions(event, dt, positions, quotas_locked):
|
||||
err = err or error_messages['unavailable']
|
||||
quota_ok = False
|
||||
break
|
||||
if quota_ok and not event.presale_end or now() < event.presale_end:
|
||||
if quota_ok and (not event.presale_end or now() < event.presale_end):
|
||||
cp = cp.clone()
|
||||
positions[i] = cp
|
||||
cp.expires = now() + timedelta(
|
||||
|
||||
@@ -107,6 +107,7 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
||||
return redirect(self.get_failure_url())
|
||||
|
||||
self.items = self._items_from_post_data()
|
||||
self._expired = self._re_add_expired_positions()
|
||||
|
||||
if not self.items:
|
||||
return redirect(self.get_failure_url())
|
||||
@@ -167,8 +168,6 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
||||
expiry = now() + timedelta(minutes=self.request.event.settings.get('reservation_time', as_type=int))
|
||||
self._extend_existing(expiry)
|
||||
|
||||
_expired = self._re_add_expired_positions()
|
||||
|
||||
# Fetch items from the database
|
||||
items_cache = {
|
||||
i.identity: i for i
|
||||
@@ -253,7 +252,7 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
||||
for quota in quotas:
|
||||
quota.release()
|
||||
|
||||
self._delete_expired(_expired)
|
||||
self._delete_expired(self._expired)
|
||||
|
||||
if not self.msg_some_unavailable:
|
||||
messages.success(self.request, _('The products have been successfully added to your cart.'))
|
||||
|
||||
Reference in New Issue
Block a user