From 86e28a175b8cc8ad9c8537b1bbb43acc74e233a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 6 Oct 2016 17:21:25 +0200 Subject: [PATCH] use topics from tabellio.config --- themis/fields/vocabs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/themis/fields/vocabs.py b/themis/fields/vocabs.py index b6184ba..e280e09 100644 --- a/themis/fields/vocabs.py +++ b/themis/fields/vocabs.py @@ -248,7 +248,15 @@ class SubjectsSource(object): implements(IContextSourceBinder) def __init__(self): - # XXX get this list from the catalog + + if ITabellioSettings: + settings = component.getUtility(IRegistry).forInterface(ITabellioSettings, False) + topics = settings.topics + if topics: + self.terms = [x.strip() for x in topics.splitlines() if x] + return + + # fallback on static list self.terms = [ u"Action sociale", u"Budget",