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

[YC-1205] fix call to url that does not exist #1003

Merged
merged 2 commits into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
Loading