aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Tokens.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-02-20 11:24:32 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-02-20 11:24:32 +0000
commit834d18012ab64e340d06f539fee17d34e0cf7675 (patch)
tree6478756405efd2a2c04b3bc9d490d396c9112d0f /perllib/FixMyStreet/App/Controller/Tokens.pm
parent7b227dea1532f3e68c369d8447611349e8cb44b6 (diff)
parent25d518e794b7d95525edaa9357adec48a4172c24 (diff)
Merge branch '972-completion-adverts'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Tokens.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm28
1 files changed, 26 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 44cb2429d..c8a7531d6 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -28,6 +28,16 @@ problem but are not logged in.
sub confirm_problem : Path('/P') {
my ( $self, $c, $token_code ) = @_;
+ if ($token_code eq '_test_') {
+ $c->stash->{report} = {
+ id => 123,
+ title => 'Title of Report',
+ bodies_str => 'True',
+ url => '/report/123',
+ };
+ return;
+ }
+
my $auth_token =
$c->forward( 'load_auth_token', [ $token_code, 'problem' ] );
@@ -37,7 +47,7 @@ sub confirm_problem : Path('/P') {
# Look at all problems, not just cobrand, in case am approving something we don't actually show
my $problem = $c->model('DB::Problem')->find( { id => $problem_id } )
|| $c->detach('token_error');
- $c->stash->{problem} = $problem;
+ $c->stash->{report} = $problem;
if ( $problem->state eq 'unconfirmed' && $auth_token->created < DateTime->now->subtract( months => 1 ) ) {
$c->stash->{template} = 'errors/generic.html';
@@ -83,7 +93,6 @@ sub confirm_problem : Path('/P') {
) if $problem->state eq 'unconfirmed';
# Subscribe problem reporter to email updates
- $c->stash->{report} = $c->stash->{problem};
$c->forward( '/report/new/create_reporter_alert' );
# log the problem creation user in to the site
@@ -135,6 +144,11 @@ alert but are not logged in.
sub confirm_alert : Path('/A') {
my ( $self, $c, $token_code ) = @_;
+ if ($token_code eq '_test_') {
+ $c->stash->{confirm_type} = $c->req->params->{confirm_type};
+ return;
+ }
+
my $auth_token = $c->forward( 'load_auth_token', [ $token_code, 'alert' ] );
# Load the problem
@@ -170,6 +184,16 @@ update but are not logged in.
sub confirm_update : Path('/C') {
my ( $self, $c, $token_code ) = @_;
+ if ($token_code eq '_test_') {
+ $c->stash->{problem} = {
+ id => 123,
+ title => 'Title of Report',
+ bodies_str => 'True',
+ url => '/report/123',
+ };
+ return;
+ }
+
my $auth_token =
$c->forward( 'load_auth_token', [ $token_code, 'comment' ] );