Skip to content

Commit

Permalink
Make content.get_vocab_values use content.get_vocab
Browse files Browse the repository at this point in the history
  • Loading branch information
gbastien committed Oct 18, 2023
1 parent 54ca445 commit ea600e8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/imio/helpers/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,8 @@ def get_vocab(context, vocab_name, only_factory=False, **kwargs):

def get_vocab_values(context, vocab_name, attr_name='token', **kwargs):
""" """
vocab_factory = getUtility(IVocabularyFactory, vocab_name)
return [getattr(term, attr_name)
for term in vocab_factory(context, **kwargs)._terms]
vocab = get_vocab(context, vocab_name, **kwargs)
return [getattr(term, attr_name) for term in vocab._terms]


def safe_delattr(obj, attr_name):
Expand Down

0 comments on commit ea600e8

Please sign in to comment.