None got turned into the string None, and then put in the URL, which
means the return URL was simply broken. In the case where there is no
return url, the link shouldn't be there at all.
@login_required
def banktransfer(request):
- return render(request, 'invoices/banktransfer.html', {
+ param = {
'title': request.GET['title'],
'amount': request.GET['amount'],
- 'returnurl': request.GET['ret'],
- })
+ }
+ if request.GET.has_key('ret'):
+ param['returnurl'] = request.GET['ret']
+
+ return render(request, 'invoices/banktransfer.html', param)
@login_required
@transaction.atomic
param = {
'title': invoicestr.encode('utf-8'),
'amount': invoiceamount,
- 'ret': returnurl,
}
+ if returnurl:
+ param['ret'] = returnurl
return "/invoices/banktransfer/?%s" % urlencode(param)