let provider fallback if there's no gnm_commune

This commit is contained in:
Frédéric Péters 2018-01-11 12:36:24 +01:00
parent 63cc27b895
commit 3929485c37
1 changed files with 2 additions and 2 deletions

View File

@ -156,8 +156,8 @@ def as_producer(slug):
# handle collectivity sites, they are individually named
# "eservices" but have the collectivity slug as a template
# variable.
producer = settings.TEMPLATE_VARS.get('gnm_commune', producer)
if settings.TEMPLATE_VARS.get('gnm_commune_name'):
producer = settings.TEMPLATE_VARS.get('gnm_commune')
if producer and settings.TEMPLATE_VARS.get('gnm_commune_name'):
return {'slug': producer,
'label': settings.TEMPLATE_VARS.get('gnm_commune_name')}
else: