aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Alert.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-04 00:52:02 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-04 00:52:02 +0100
commitb388fd0be5296426225089ed188b3c1cdd802415 (patch)
tree743c52675d1738618557f46f853ac46dd8b8530f /perllib/FixMyStreet/App/Controller/Alert.pm
parentb019beb393534919c249fa16e7ab07ac63fa52c5 (diff)
Migrate alert sending script, add test for it, fix some small bugs and strings.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Alert.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Alert.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm
index d8e783431..b3067abc9 100644
--- a/perllib/FixMyStreet/App/Controller/Alert.pm
+++ b/perllib/FixMyStreet/App/Controller/Alert.pm
@@ -63,6 +63,9 @@ sub subscribe : Path('subscribe') : Args(0) {
elsif ( exists $c->req->params->{'rznvy'} ) {
$c->detach('subscribe_email');
}
+ elsif ( $c->req->params->{'id'} ) {
+ $c->go('updates');
+ }
# shouldn't get to here but if we have then do something sensible
$c->go('index');
@@ -198,7 +201,7 @@ sub create_alert : Private {
$options->{cobrand_data} = $c->cobrand->extra_update_data();
$options->{lang} = $c->stash->{lang_code};
- if ( $c->user && $c->user->id == $c->stash->{alert_user}->id ) {
+ if ( $c->user && $c->stash->{alert_user}->in_storage && $c->user->id == $c->stash->{alert_user}->id ) {
$options->{confirmed} = 1;
}