Skip to content

Commit

Permalink
ps: update to prevent situations where users were trying to circumven…
Browse files Browse the repository at this point in the history
…t the payment process
  • Loading branch information
rayrayndwiga committed Nov 2, 2017
1 parent 7d19991 commit a551580
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parkstay/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,16 @@ def get(self, request, *args, **kwargs):
try:
inv = Invoice.objects.get(reference=invoice_ref)
except Invoice.DoesNotExist:
logger.error('User {} with id {} tried making a booking with an incorrect invoice'.format(booking.customer.get_full_name(),booking.customer.id))
logger.error('{} tried making a booking with an incorrect invoice'.format('User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else 'An anonymous user'))
return redirect('public_make_booking')

if inv.system not in ['0019']:
logger.error('User {} with id {} tried making a booking with an invoice from another system with reference number {}'.format(booking.customer.get_full_name(),booking.customer.id,inv.reference))
logger.error('{} tried making a booking with an invoice from another system with reference number {}'.format('User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else 'An anonymous user',inv.reference))
return redirect('public_make_booking')

try:
b = BookingInvoice.objects.get(invoice_reference=invoice_ref)
logger.error('User {} with id {} tried making a booking with an already used invoice with reference number {}'.format(booking.customer.get_full_name(),booking.customer.id,inv.reference))
logger.error('{} tried making a booking with an already used invoice with reference number {}'.format('User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else 'An anonymous user',inv.reference))
return redirect('public_make_booking')
except BookingInvoice.DoesNotExist:

Expand Down

0 comments on commit a551580

Please sign in to comment.