aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-05-19 17:07:24 +0100
committerStruan Donald <struan@exo.org.uk>2011-05-19 17:09:33 +0100
commit1463288a3282ec5d0f195e2ed44253b78f5b915b (patch)
tree0a011f8785078cabcdd32d21e26eb278b49d6339 /perllib/FixMyStreet/App/Controller/Report/Update.pm
parent4d2520605ddbc644a2e835a967659e92511e7961 (diff)
create token for comment confirmation correctly
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 691a4ecc9..d9136698d 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -249,15 +249,23 @@ sub redirect_or_confirm_creation : Private {
}
# otherwise create a confirm token and email it to them.
- my $token =
- $c->model("DB::Token")
- ->create( { scope => 'comment', data => $update->id } );
+ my $token = $c->model("DB::Token")->create(
+ {
+ scope => 'comment',
+ data => {
+ id => $update->id,
+ add_alert => ( $c->req->param('add_alert') ? 1 : 0 ),
+ }
+ }
+ );
$c->stash->{token_url} = $c->uri_for_email( '/C', $token->token );
$c->send_email( 'update-confirm.txt', { to => $update->user->email } );
# tell user that they've been sent an email
$c->stash->{template} = 'email_sent.html';
$c->stash->{email_type} = 'update';
+
+ return 1;
}
__PACKAGE__->meta->make_immutable;