aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorM Somerville <matthew-github@dracos.co.uk>2020-09-18 20:11:31 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-09-25 11:59:52 +0100
commitba1179d0378a35809f4eb2df0ceb3e189c4bd1bc (patch)
tree24d868cbd7ef96c8e13a57bec2ee362090cf5583 /perllib/FixMyStreet/App/Controller/Report/New.pm
parent49a2bf517a60d71b251bdf7e23e5717c792f527d (diff)
Show username error in correct place only.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index e7b4d70a7..d6314dacf 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1250,6 +1250,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 || $c->stash->{login_success};