super(PurchaseVouchersForm, self).__init__(*args, **kwargs)
activeQ = Q(activeuntil__isnull=True) | Q(activeuntil__gt=date.today())
if self.data and self.data.has_key('regtype') and self.data['regtype'] and self.data.has_key('num') and self.data['num'] and _int_with_default(self.data['num'], 0) > 0:
- rt = RegistrationType.objects.get(pk=self.data['regtype'])
+ RegistrationType.objects.get(pk=self.data['regtype'])
self.fields['confirm'].help_text = 'Check this box to confirm that you will pay the generated invoice'
self.fields['num'].widget.attrs['readonly'] = True
self.fields['regtype'].queryset = RegistrationType.objects.filter(pk=self.data['regtype'])
@superuser_required
def sponsor_admin_test_vat(request, confurlname):
- conference = get_object_or_404(Conference, urlname=confurlname)
+ get_object_or_404(Conference, urlname=confurlname)
vn = request.POST.get('vatnumber', '')
if not vn:
# Trustly request was successful, so we have an url to send the user to. Let's set up
# the transaction on our end.
- trans = TrustlyTransaction(createdat=datetime.now(),
- invoiceid=invoice.id,
- amount=invoice.total_amount,
- orderid=r['data']['orderid'],
- redirecturl=r['data']['url'],
- ).save()
+ TrustlyTransaction(createdat=datetime.now(),
+ invoiceid=invoice.id,
+ amount=invoice.total_amount,
+ orderid=r['data']['orderid'],
+ redirecturl=r['data']['url'],
+ ).save()
# With the transaction saved, redirect the user to Trustly
return HttpResponseRedirect(r['data']['url'])
def success(request, invoiceid, secret):
# Get the invoice so we can be sure that we have the secret
- invoice = get_object_or_404(Invoice, id=invoiceid, recipient_secret=secret)
+ get_object_or_404(Invoice, id=invoiceid, recipient_secret=secret)
trans = get_object_or_404(TrustlyTransaction, invoiceid=invoiceid)
if trans.completedat:
m = self._re_braintree.match(invoice.paymentdetails)
if m:
try:
- trans = BraintreeTransaction.objects.get(transid=m.groups(1)[0])
+ BraintreeTransaction.objects.get(transid=m.groups(1)[0])
except BraintreeTransaction.DoesNotExzist:
return (None, "not found")
else: