# HG changeset patch # User bsw # Date 1533137176 -7200 # Node ID 74ce9970605b4fb8242c8cda3d56a7232f39fa22 # Parent 7cdc685bb7a6c9e2b3e675017d6451f783e96639 Allow empty optional registration fields diff -r 7cdc685bb7a6 -r 74ce9970605b app/main/registration/_action/register.lua --- a/app/main/registration/_action/register.lua Wed Aug 01 17:21:01 2018 +0200 +++ b/app/main/registration/_action/register.lua Wed Aug 01 17:26:16 2018 +0200 @@ -138,7 +138,7 @@ else local value = param.get("verification_data_" .. field.name) - if not value or (#value < 1 and (not manual_verification or field.name ~= "mobile_phone")) then + if not field.optional and (not value or (#value < 1 and (not manual_verification or field.name ~= "mobile_phone"))) then slot.put_into("self_registration__invalid_" .. field.name, "to_short") slot.select("error", function() ui.container{ content = _("Please enter: #{field_name}", { field_name = field.label }) }