summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-10-25 06:55:46 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-10-25 07:55:29 (GMT)
commit0f0353266e3641b6828115fc238af97535cb9c77 (patch)
tree5a03f8ca4befa3a6284aff7ae816fc2ba78b564e
parentb2904f0291d1e4179f4e825c68c8c2515e9cc637 (diff)
downloadcombo-0f0353266e3641b6828115fc238af97535cb9c77.zip
combo-0f0353266e3641b6828115fc238af97535cb9c77.tar.gz
combo-0f0353266e3641b6828115fc238af97535cb9c77.tar.bz2
lingo: redirect to homepage if there's no basket page (#37210)
-rw-r--r--combo/apps/lingo/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/combo/apps/lingo/views.py b/combo/apps/lingo/views.py
index 18670f6..80362a1 100644
--- a/combo/apps/lingo/views.py
+++ b/combo/apps/lingo/views.py
@@ -62,7 +62,10 @@ def get_eopayment_object(request, regie_or_payment_backend):
def get_basket_url():
- return LingoBasketCell.objects.all()[0].page.get_online_url()
+ basket_cell = LingoBasketCell.objects.filter(page__snapshot__isnull=True).first()
+ if basket_cell:
+ return basket_cell.page.get_online_url()
+ return '/'
def lingo_check_request_signature(request):