# HG changeset patch # User bsw # Date 1533308826 -7200 # Node ID 1a55c68445d4b3ee73c0bb5750615f15874a727b # Parent 136d08af1529dfd6edcfb24c9430513ecf18433f Allow empty selection for unit registration field diff -r 136d08af1529 -r 1a55c68445d4 app/main/registration/_register_form.lua --- a/app/main/registration/_register_form.lua Fri Aug 03 17:05:27 2018 +0200 +++ b/app/main/registration/_register_form.lua Fri Aug 03 17:07:06 2018 +0200 @@ -93,6 +93,12 @@ units_selector:add_where(field.where) end local units = units_selector:exec() + if field.optional then + table.insert(units, { + id = "", + name = _"None" + }) + end ui.field.select{ label = field.label, foreign_records = units,