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', my_config.get(section, url + '.pattern',
False, qfields)]) False, qfields)])
except InterpolationMissingOptionError, e: except InterpolationMissingOptionError, e:
data.append(['error', section, url, if e.reference in _FIELDNAMES_MAP:
_('Missing input: %s') % \ data.append(['error', section, url,
_(_FIELDNAMES_MAP[e.reference])]) _('Missing input: %s') % \
_(_FIELDNAMES_MAP[e.reference])])
else:
data.append(['error', section, url,
_('Missing input: %s') % e.reference])
return data return data