diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-09-11 18:11:03 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-09-25 16:20:40 +0100 |
commit | 2abe443efb8bbbd7cf3048eec271fd28a777932f (patch) | |
tree | ed7c25c63e9774e851152224078621b2016229be /perllib/FixMyStreet/App/Controller/Report/Update.pm | |
parent | 82a3e9bfcf094538db75755f63984a428670dedd (diff) |
Show error if text confirmation code sending fails
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 02d3d2ae8..2acafc654 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -592,6 +592,11 @@ sub send_confirmation_text : Private { my ( $self, $c ) = @_; my $update = $c->stash->{update}; $c->forward('/auth/phone/send_token', [ $c->stash->{token_data}, 'comment', $update->user->phone ]); + my $error = $c->render_fragment( 'auth/_username_error.html', { default => 'phone' }); + if ($error) { + $c->stash->{field_errors}{username_register} = $error; + $c->go( '/report/display', [ $c->stash->{problem}->id ], [] ); + } $c->stash->{submit_url} = '/report/update/text'; } |