Improve BillingAddress string representation
Include VAT number if available
This commit is contained in:
parent
202a514b1b
commit
2d66ae6783
1 changed files with 10 additions and 4 deletions
|
@ -21,10 +21,16 @@ class BaseBillingAddress(models.Model):
|
||||||
|
|
||||||
class BillingAddress(BaseBillingAddress):
|
class BillingAddress(BaseBillingAddress):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s, %s, %s, %s, %s" % (
|
if self.vat_number:
|
||||||
self.cardholder_name, self.street_address, self.city,
|
return "%s, %s, %s, %s, %s, %s" % (
|
||||||
self.postal_code, self.country
|
self.cardholder_name, self.street_address, self.city,
|
||||||
)
|
self.postal_code, self.country, self.vat_number
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return "%s, %s, %s, %s, %s" % (
|
||||||
|
self.cardholder_name, self.street_address, self.city,
|
||||||
|
self.postal_code, self.country
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class UserBillingAddress(BaseBillingAddress):
|
class UserBillingAddress(BaseBillingAddress):
|
||||||
|
|
Loading…
Reference in a new issue