Skip to content
This repository was archived by the owner on Jan 25, 2018. It is now read-only.

Commit 4acc352

Browse files
committed
Cope with trans_id KeyError maybe (bug 900153)
1 parent 204a7cb commit 4acc352

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

webpay/pay/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,14 @@ def wait_to_start(request):
198198
When ready, redirect to the Bango payment URL using
199199
the generated billing configuration ID.
200200
"""
201+
trans_id = request.session.get('trans_id', None)
202+
if not trans_id:
203+
# This seems like a seriously problem but maybe there is just a race
204+
# condition. If we see a lot of these in the logs it means the
205+
# payment will never complete so we should keep an eye on it.
206+
log.error('wait_to_start() session trans_id was None')
201207
try:
202-
trans = solitude.get_transaction(request.session['trans_id'])
208+
trans = solitude.get_transaction(trans_id)
203209
except ObjectDoesNotExist:
204210
trans = {'status': None}
205211

0 commit comments

Comments
 (0)