Don't store return values if we're not going to use them
authorMagnus Hagander <magnus@hagander.net>
Fri, 29 Jun 2018 11:30:17 +0000 (13:30 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 29 Jun 2018 11:30:17 +0000 (13:30 +0200)
postgresqleu/confsponsor/forms.py
postgresqleu/confsponsor/views.py
postgresqleu/trustlypayment/views.py
postgresqleu/util/payment/braintree.py

index af25720a6abff7ce7610001b37e2f8aa5d3350e2..55ce99e981ff6a88cab0419b2e38faa3c96bce93 100644 (file)
@@ -123,7 +123,7 @@ class PurchaseVouchersForm(forms.Form):
                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'])
index ec7ca3fa4cbecaf9655e558072bf357e93c6de5c..fd4a5a814ac67a96caae3a78526553a618d47d3c 100644 (file)
@@ -680,7 +680,7 @@ def sponsor_admin_imageview(request, benefitid):
 
 @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:
index a66730fbea0d8719a1934d2f1320a5c144b9b4ec..bbf973abec1eac91c641041b5d3b84fd7fb4f7f7 100644 (file)
@@ -60,12 +60,12 @@ def invoicepayment_secret(request, invoiceid, secret):
                # 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'])
@@ -75,7 +75,7 @@ def invoicepayment_secret(request, invoiceid, secret):
 
 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:
index 0d9cd84fd810601bb2acae8800f577177a4d3457..d21df6648ab768e4efdcf5c6ae66d5069676c734 100644 (file)
@@ -21,7 +21,7 @@ Mastercard, VISA and American Express.
                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: