Skip to content

Commit

Permalink
add default value for additional fields of persons to prevent Attribu…
Browse files Browse the repository at this point in the history
…teError while person creation, closes seiferta#44
  • Loading branch information
seiferta committed Aug 5, 2016
1 parent 4055127 commit f26e64d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emonitor/modules/persons/content_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def getAdminContent(self, **params):
person.identifier = request.form.get('identifier')
person.remark = request.form.get('remark')
_additional = {}
for field in Settings.get('persons.settings').get('additional'):
for field in Settings.get('persons.settings', {}).get('additional', []):
if field.split('=')[0] in request.form.keys() and request.form.get(field.split('=')[0]).strip() != '':
_additional[field.split('=')[0]] = request.form.get(field.split('=')[0])
person._options = yaml.safe_dump(_additional, encoding='utf-8')
Expand Down

0 comments on commit f26e64d

Please sign in to comment.