Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix call to url that does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
monodo committed May 28, 2024
1 parent 4a809a6 commit 5d8de80
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions geocity/apps/accounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,13 +1011,11 @@ def sortable_str(self, obj):

@admin.display(boolean=True)
def has_background_image(self, obj):
try:
return obj.background_image.url is not None
except ValueError:
return False
return False if obj.background_image.name == "" else True

has_background_image.admin_order_field = "background_image"
has_background_image.short_description = "Image de fond"
if has_background_image:
has_background_image.admin_order_field = "background_image"
has_background_image.short_description = "Image de fond"


# Inline for base Django Site
Expand Down

0 comments on commit 5d8de80

Please sign in to comment.