Merge pull request #195 from bornhack/feature/improve_shop_product_admin
Woops, available_in can be null
This commit is contained in:
commit
914c4e456e
|
@ -35,11 +35,15 @@ class ProductCategoryAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
def available_from(product):
|
def available_from(product):
|
||||||
|
if product.available_in:
|
||||||
return product.available_in.lower.strftime("%c")
|
return product.available_in.lower.strftime("%c")
|
||||||
|
return "None"
|
||||||
available_from.short_description = 'Available from'
|
available_from.short_description = 'Available from'
|
||||||
|
|
||||||
def available_to(product):
|
def available_to(product):
|
||||||
|
if product.available_in:
|
||||||
return product.available_in.upper.strftime("%c")
|
return product.available_in.upper.strftime("%c")
|
||||||
|
return "None"
|
||||||
available_to.short_description = 'Available to'
|
available_to.short_description = 'Available to'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue