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

Commit

Permalink
Cope with trans_id KeyError maybe (bug 900153)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar303 committed Jul 31, 2013
1 parent 204a7cb commit 4acc352
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webpay/pay/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,14 @@ def wait_to_start(request):
When ready, redirect to the Bango payment URL using
the generated billing configuration ID.
"""
trans_id = request.session.get('trans_id', None)
if not trans_id:
# This seems like a seriously problem but maybe there is just a race
# condition. If we see a lot of these in the logs it means the
# payment will never complete so we should keep an eye on it.
log.error('wait_to_start() session trans_id was None')
try:
trans = solitude.get_transaction(request.session['trans_id'])
trans = solitude.get_transaction(trans_id)
except ObjectDoesNotExist:
trans = {'status': None}

Expand Down

0 comments on commit 4acc352

Please sign in to comment.