mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +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']
|
err = err or error_messages['unavailable']
|
||||||
quota_ok = False
|
quota_ok = False
|
||||||
break
|
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()
|
cp = cp.clone()
|
||||||
positions[i] = cp
|
positions[i] = cp
|
||||||
cp.expires = now() + timedelta(
|
cp.expires = now() + timedelta(
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
|||||||
return redirect(self.get_failure_url())
|
return redirect(self.get_failure_url())
|
||||||
|
|
||||||
self.items = self._items_from_post_data()
|
self.items = self._items_from_post_data()
|
||||||
|
self._expired = self._re_add_expired_positions()
|
||||||
|
|
||||||
if not self.items:
|
if not self.items:
|
||||||
return redirect(self.get_failure_url())
|
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))
|
expiry = now() + timedelta(minutes=self.request.event.settings.get('reservation_time', as_type=int))
|
||||||
self._extend_existing(expiry)
|
self._extend_existing(expiry)
|
||||||
|
|
||||||
_expired = self._re_add_expired_positions()
|
|
||||||
|
|
||||||
# Fetch items from the database
|
# Fetch items from the database
|
||||||
items_cache = {
|
items_cache = {
|
||||||
i.identity: i for i
|
i.identity: i for i
|
||||||
@@ -253,7 +252,7 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
|||||||
for quota in quotas:
|
for quota in quotas:
|
||||||
quota.release()
|
quota.release()
|
||||||
|
|
||||||
self._delete_expired(_expired)
|
self._delete_expired(self._expired)
|
||||||
|
|
||||||
if not self.msg_some_unavailable:
|
if not self.msg_some_unavailable:
|
||||||
messages.success(self.request, _('The products have been successfully added to your cart.'))
|
messages.success(self.request, _('The products have been successfully added to your cart.'))
|
||||||
|
|||||||
Reference in New Issue
Block a user