Skip to content

Commit 10d2773

Browse files
authored
Return empty string as label if we don't have keywords (#13656)
1 parent e57fdc0 commit 10d2773

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

geonode/base/fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ def label_from_instance(self, obj):
2525
# Note: Not using .get() because filter()[0] is used in original
2626
# code. The hard-coded language is currently used throughout
2727
# geonode.
28-
return obj.keyword.first().label
28+
first_keyword = obj.keyword.first()
29+
return first_keyword.label if first_keyword else ""

0 commit comments

Comments
 (0)