Skip to content

Commit

Permalink
Unicode bodges for Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Percival committed Feb 21, 2018
1 parent 602cd85 commit 31aaee1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ledger/payments/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def create(self, request):
else:
basket = createBasket(serializer.validated_data['products'],request.user,serializer.validated_data['system'])

redirect = HttpResponseRedirect(reverse('checkout:index')+'?{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}'.format(
redirect = HttpResponseRedirect(reverse('checkout:index')+u'?{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}&{}'.format(
self.get_redirect_value(serializer,'card_method'),
self.get_redirect_value(serializer,'basket_owner'),
self.get_redirect_value(serializer,'template'),
Expand Down
10 changes: 5 additions & 5 deletions parkstay/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def post(self, request, *args, **kwargs):
booking.campground.name
)

logger.info('{} built booking {} and handing over to payment gateway'.format('User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else 'An anonymous user',booking.id))
logger.info(u'{} built booking {} and handing over to payment gateway'.format(u'User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else u'An anonymous user',booking.id))

response = utils.checkout(request, booking, lines, invoice_text=reservation)
result = HttpResponse(
Expand Down Expand Up @@ -321,19 +321,19 @@ def get(self, request, *args, **kwargs):
try:
inv = Invoice.objects.get(reference=invoice_ref)
except Invoice.DoesNotExist:
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'))
logger.error(u'{} tried making a booking with an incorrect invoice'.format(u'User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else u'An anonymous user'))
return redirect('public_make_booking')

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

try:
b = BookingInvoice.objects.get(invoice_reference=invoice_ref)
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))
logger.error(u'{} tried making a booking with an already used invoice with reference number {}'.format(u'User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else u'An anonymous user',inv.reference))
return redirect('public_make_booking')
except BookingInvoice.DoesNotExist:
logger.info('{} finished temporary booking {}, creating new BookingInvoice with reference {}'.format('User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else 'An anonymous user',booking.id, invoice_ref))
logger.info(u'{} finished temporary booking {}, creating new BookingInvoice with reference {}'.format(u'User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else u'An anonymous user',booking.id, invoice_ref))
# FIXME: replace with server side notify_url callback
book_inv, created = BookingInvoice.objects.get_or_create(booking=booking, invoice_reference=invoice_ref)

Expand Down

0 comments on commit 31aaee1

Please sign in to comment.