Changed interpretation of '' in form handling of integer properties.

This commit is contained in:
Sybren A. Stüvel 2017-03-28 16:04:40 +02:00
parent fcaa4fb936
commit fd541d2243

View File

@ -168,8 +168,8 @@ def process_node_form(form, node_id=None, node_type=None, user=None):
if schema_prop['type'] == 'dict': if schema_prop['type'] == 'dict':
data = attachments.attachment_form_parse_post_data(data) data = attachments.attachment_form_parse_post_data(data)
elif schema_prop['type'] == 'integer': elif schema_prop['type'] == 'integer':
if data == '': if not data:
data = 0 data = None
else: else:
data = int(form[prop_name].data) data = int(form[prop_name].data)
elif schema_prop['type'] == 'float': elif schema_prop['type'] == 'float':