summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2016-10-06 15:21:25 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2016-10-06 15:22:38 (GMT)
commit86e28a175b8cc8ad9c8537b1bbb43acc74e233a7 (patch)
tree835849faa07e36803993e271f15a33d20a23ab4b
parent554360b04b833cd0d4621db91603f4599eb047db (diff)
downloadthemis.fields-86e28a175b8cc8ad9c8537b1bbb43acc74e233a7.zip
themis.fields-86e28a175b8cc8ad9c8537b1bbb43acc74e233a7.tar.gz
themis.fields-86e28a175b8cc8ad9c8537b1bbb43acc74e233a7.tar.bz2
use topics from tabellio.config
-rw-r--r--themis/fields/vocabs.py10
1 files changed, 9 insertions, 1 deletions
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",