Skip to content

Commit

Permalink
Improved check on token
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-andreotti committed Mar 27, 2024
1 parent c343f83 commit c72c507
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redturtle/bandi/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ def tipologia_bando_label(object, **kw):
if not object.tipologia_bando:
return None
vocab = TipologiaBandoVocabulary().__call__(object)
try:
vocab.getTermByToken(object.tipologia_bando)
except LookupError:
return None
return vocab.getTermByToken(object.tipologia_bando).title

0 comments on commit c72c507

Please sign in to comment.