Commit de7e253b authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

[hal_json] Default field value to field.id first and then to its key

parent e2ada530
......@@ -565,7 +565,7 @@ def getFieldDefault(form, field, key, value=None):
Previously we used Formulator.Field._get_default which is (for no reason) private.
"""
if value is None:
value = REQUEST.form.get(key, MARKER)
value = REQUEST.form.get(field.id, REQUEST.form.get(key, MARKER))
# use marker because default value can be intentionally empty string
if value is MARKER:
value = field.get_value('default', request=REQUEST, REQUEST=REQUEST)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment