improve handling of missing fields

This commit is contained in:
Jan Dittberner 2010-06-03 21:58:44 +02:00
parent c3afa11013
commit 19e6e0f191

View file

@ -71,7 +71,11 @@ def build_urls(fields):
my_config.get(section, url + '.pattern',
False, qfields)])
except InterpolationMissingOptionError, e:
data.append(['error', section, url,
_('Missing input: %s') % \
_(_FIELDNAMES_MAP[e.reference])])
if e.reference in _FIELDNAMES_MAP:
data.append(['error', section, url,
_('Missing input: %s') % \
_(_FIELDNAMES_MAP[e.reference])])
else:
data.append(['error', section, url,
_('Missing input: %s') % e.reference])
return data