also look for producer in collectivity labels (#26774)

This commit is contained in:
Frédéric Péters 2018-10-02 10:24:40 +02:00
parent c6866209a4
commit 44815f339f
1 changed files with 3 additions and 0 deletions

View File

@ -436,6 +436,9 @@ def as_producer(slug):
'label': settings.KNOWN_SERVICES['hobo'].get('_interco_hobo-%s' % producer, {'title': ''})['title']}
elif producer in settings.PRODUCER_LABELS:
return {'slug': producer, 'label': settings.PRODUCER_LABELS[producer]}
elif producer in settings.COLLECTIVITY_LABELS.values():
collectivity = [x for x in settings.COLLECTIVITY_LABELS.items() if x[1] == producer][0]
return {'slug': collectivity[0], 'label': collectivity[1]}
else:
return {'slug': 'toodego', 'label': 'Toodego'}