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

Commit

Permalink
[YC-1205] fix call to url that does not exist (#1003)
Browse files Browse the repository at this point in the history
* fix call to url that does not exist

* adress review comments
  • Loading branch information
monodo authored May 28, 2024
1 parent 2eacf14 commit e554f4d
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 @@ -1012,13 +1012,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 True if obj.background_image.name else False

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 e554f4d

Please sign in to comment.