diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-09-18 20:11:31 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-09-25 11:59:52 +0100 |
commit | ba1179d0378a35809f4eb2df0ceb3e189c4bd1bc (patch) | |
tree | 24d868cbd7ef96c8e13a57bec2ee362090cf5583 /perllib/FixMyStreet/App/Controller/Report/Update.pm | |
parent | 49a2bf517a60d71b251bdf7e23e5717c792f527d (diff) |
Show username error in correct place only.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 8ffba3dcf..0fbdc6ce2 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -404,6 +404,16 @@ sub check_for_errors : Private { $field_errors{photo} = $photo_error; } + # Now assign the username error according to where it came from + if ($field_errors{username}) { + if ($c->get_param('submit_sign_in') || $c->get_param('password_sign_in')) { + $field_errors{username_sign_in} = $field_errors{username}; + } else { + $field_errors{username_register} = $field_errors{username}; + } + delete $field_errors{username}; + } + # all good if no errors return 1 unless ( scalar keys %field_errors |