Skip to content

Commit

Permalink
handle null-ish arguments in template tags
Browse files Browse the repository at this point in the history
  • Loading branch information
knifecake committed Dec 27, 2024
1 parent 3dad445 commit de8fa9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anchor/templatetags/anchor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def blob_url(value: Blob | Attachment | None):
"""
Return a signed URL for the given Attachment or Blob.
"""
if value is None:
if value is None or value == "":
return ""

return reverse(
Expand All @@ -33,7 +33,7 @@ def representation_url(value: Variant | Blob | Attachment | None, **transformati
"""
Return a signed URL for a transformation of the given Attachment or Blob.
"""
if value is None:
if value is None or value == "":
return ""

if isinstance(value, Variant):
Expand Down

0 comments on commit de8fa9d

Please sign in to comment.