Skip to content

Commit

Permalink
Merge pull request awesto#226 from jrief/add-callable
Browse files Browse the repository at this point in the history
Add callable
  • Loading branch information
chrisglass committed May 2, 2013
2 parents 7675ef4 + f578e8e commit 0fb2258
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shop/models_bases/__init__.py
Expand Up @@ -419,7 +419,7 @@ def set_billing_address(self, billing_address):
e.g. you can copy address instance and save FK to it in your order
class.
"""
if hasattr(billing_address, 'as_text'):
if hasattr(billing_address, 'as_text') and callable(billing_address.as_text):
self.billing_address_text = billing_address.as_text()
self.save()

Expand All @@ -431,7 +431,7 @@ def set_shipping_address(self, shipping_address):
e.g. you can copy address instance and save FK to it in your order
class.
"""
if hasattr(shipping_address, 'as_text'):
if hasattr(shipping_address, 'as_text') and callable(shipping_address.as_text):
self.shipping_address_text = shipping_address.as_text()
self.save()

Expand Down

0 comments on commit 0fb2258

Please sign in to comment.