# HG changeset patch # User bsw # Date 1533309257 -7200 # Node ID 2efee7c3bf440c9d4b03285fc8b0d4d14a21e0ee # Parent 5bbec1fd769dddf8b6a1b40aec6d53e123ef9428 Process unit registration field diff -r 5bbec1fd769d -r 2efee7c3bf44 app/main/registration/_action/register.lua --- a/app/main/registration/_action/register.lua Fri Aug 03 17:10:46 2018 +0200 +++ b/app/main/registration/_action/register.lua Fri Aug 03 17:14:17 2018 +0200 @@ -135,7 +135,7 @@ return end verification.request_data[field.name] = string.format("%04i-%02i-%02i", year, month, day) - + else local value = param.get("verification_data_" .. field.name) if not field.optional and (not value or (#value < 1 and (not manual_verification or field.name ~= "mobile_phone"))) then @@ -150,6 +150,7 @@ value = string.gsub(value, "[^A-Z0-9]", "") elseif field.name == "mobile_phone" then value = string.gsub(value, "[^0-9]", "") + elseif field.type == "image" then else value = string.gsub(value, "^%s+", "") value = string.gsub(value, "%s+$", "") diff -r 5bbec1fd769d -r 2efee7c3bf44 app/main/registration/_register_form.lua --- a/app/main/registration/_register_form.lua Fri Aug 03 17:10:46 2018 +0200 +++ b/app/main/registration/_register_form.lua Fri Aug 03 17:14:17 2018 +0200 @@ -88,7 +88,7 @@ elseif field.type == "image" then ui.tag{ tag = "label", content = field.label } - ui.tag{ tag = "input", attr = { type = "file", name = field.name } } + ui.tag{ tag = "input", attr = { type = "file", name = "verification_data_" .. field.name } } elseif field.name == "unit" then local units_selector = Unit:new_selector()