Correct the way to get the first object
This commit is contained in:
parent
110459b38d
commit
752b61a852
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ def validate_vat_number(stripe_customer_id, vat_number):
|
|||
logger.debug("BillingAddress does not exist for %s" % vat_number)
|
||||
except BillingAddress.MultipleObjectsReturned as mor:
|
||||
logger.debug("Multiple BillingAddress exist for %s" % vat_number)
|
||||
billing_address = BillingAddress.objects.last(vat_number=vat_number)
|
||||
billing_address = BillingAddress.objects.all(vat_number=vat_number).order_by('-id').first()
|
||||
if billing_address is not None:
|
||||
if billing_address.vat_number_validated_on:
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue