utils: add a notempty transformation for attribute mappings (fixes #19233)

This commit is contained in:
Benjamin Dauvergne 2017-10-05 15:33:08 +02:00
parent 0597b3e27e
commit 39ea7fb75c
1 changed files with 2 additions and 0 deletions

View File

@ -87,6 +87,8 @@ def mapping_to_value(mapping, user_info):
elif mapping['translation'] == 'simple':
value = mapping['translation_simple'].get(
value, mapping.get('translation_simple_default', ''))
elif mapping['translation'] == 'notempty':
value = bool(value)
else:
raise NotImplementedError
return value