liquid_feedback_frontend
changeset 1332:2efee7c3bf44
Process unit registration field
author | bsw |
---|---|
date | Fri Aug 03 17:14:17 2018 +0200 (2018-08-03) |
parents | 5bbec1fd769d |
children | 21a2443c97d7 |
files | app/main/registration/_action/register.lua app/main/registration/_register_form.lua |
line diff
1.1 --- a/app/main/registration/_action/register.lua Fri Aug 03 17:10:46 2018 +0200 1.2 +++ b/app/main/registration/_action/register.lua Fri Aug 03 17:14:17 2018 +0200 1.3 @@ -135,7 +135,7 @@ 1.4 return 1.5 end 1.6 verification.request_data[field.name] = string.format("%04i-%02i-%02i", year, month, day) 1.7 - 1.8 + 1.9 else 1.10 local value = param.get("verification_data_" .. field.name) 1.11 if not field.optional and (not value or (#value < 1 and (not manual_verification or field.name ~= "mobile_phone"))) then 1.12 @@ -150,6 +150,7 @@ 1.13 value = string.gsub(value, "[^A-Z0-9]", "") 1.14 elseif field.name == "mobile_phone" then 1.15 value = string.gsub(value, "[^0-9]", "") 1.16 + elseif field.type == "image" then 1.17 else 1.18 value = string.gsub(value, "^%s+", "") 1.19 value = string.gsub(value, "%s+$", "")
2.1 --- a/app/main/registration/_register_form.lua Fri Aug 03 17:10:46 2018 +0200 2.2 +++ b/app/main/registration/_register_form.lua Fri Aug 03 17:14:17 2018 +0200 2.3 @@ -88,7 +88,7 @@ 2.4 2.5 elseif field.type == "image" then 2.6 ui.tag{ tag = "label", content = field.label } 2.7 - ui.tag{ tag = "input", attr = { type = "file", name = field.name } } 2.8 + ui.tag{ tag = "input", attr = { type = "file", name = "verification_data_" .. field.name } } 2.9 2.10 elseif field.name == "unit" then 2.11 local units_selector = Unit:new_selector()