diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 5 |
2 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 ad2649aa3..d676e2856 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1340,6 +1340,11 @@ sub send_problem_confirm_text : Private { $data->{id} = $report->id; $c->forward('/auth/phone/send_token', [ $data, 'problem', $report->user->phone ]); + my $error = $c->render_fragment( 'auth/_username_error.html', { default => 'phone' }); + if ($error) { + $c->stash->{field_errors}{phone} = $error; + $c->forward('generate_map'); + } $c->stash->{submit_url} = '/report/new/text'; } 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'; } |