Skip to content

Commit 7ee46b5

Browse files
authored
fix: empty urlfield in readonly display (#1448)
1 parent 70a86ec commit 7ee46b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unfold/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _get_contents(self) -> str:
139139
result_repr = display_for_field(value, f, self.empty_value_display)
140140
return conditional_escape(result_repr)
141141
elif isinstance(f, models.URLField):
142-
return format_html(
142+
return value and format_html(
143143
'<a href="{}" class="text-primary-600 dark:text-primary-500">{}</a>',
144144
value,
145145
value,

0 commit comments

Comments
 (0)