Skip to content

Commit

Permalink
Restrict Basket to OPEN and SUBMITTED
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondbca committed Oct 23, 2020
1 parent 1562cbd commit e324a08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ledger/basket/middleware.py
Expand Up @@ -38,6 +38,10 @@ def get_cookie_basket(self, cookie_key, request, manager):
basket_id = Signer(sep='|').unsign(basket_hash)
#basket = Basket.objects.get(pk=basket_id, owner=None, status=Basket.OPEN)
basket = Basket.objects.get(pk=basket_id)
if basket.status != 'OPEN' or basket.status != 'SUBMITTED':
pass
else:
basket = None
except (BadSignature, Basket.DoesNotExist):
request.cookies_to_delete.append(cookie_key)
return basket
Expand Down

0 comments on commit e324a08

Please sign in to comment.