Skip to content

Commit

Permalink
changing raiseHTTP404 to build_error
Browse files Browse the repository at this point in the history
  • Loading branch information
gcmalloc committed Jan 13, 2014
1 parent 999b02e commit b234e8d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/paiements/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ def ipn(request):
(who, pk) = orderId.split('-', 2)
else:
#should also raise an error
build_error('UNVALID_ ID')
return build_error('UNVALID_ ID')

if who != 'polybanking':
raise Http404
return build_error('UNVALID_BANK', error_code=404)

# Get transaction
t = get_object_or_404(Transaction, pk=pk, config__active=True, config__admin_enable=True)

if t.internal_status == 'cr':
raise Http404
return build_error('UNVALID_STATUS', error_code=404)

postFinance = buildPostFinance(t.config.test_mode)

Expand All @@ -151,8 +151,8 @@ def ipn(request):
if val:
args[a.upper()] = val

if request.POST.get('SHASIGN').upper() != postFinance.computeOutSign(args).upper():
raise Http404
if request.POST.get('SHASIGN', '').upper() != postFinance.computeOutSign(args).upper():
return build_error('UNVALID_SHA', error_code=404)

# Let's catch the ID
if not t.postfinance_id:
Expand Down

0 comments on commit b234e8d

Please sign in to comment.