diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-23 16:08:20 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-23 16:08:20 +0100 |
commit | 2264d094189ff9d5e1c52b58329fc191f97c3fd6 (patch) | |
tree | 4a9d037f260cc984192db6d5664e423baa577423 /perllib/FixMyStreet/App/Controller/Report/Update.pm | |
parent | 46848a1dd7a7e33cb8953df334f434d0450b5651 (diff) | |
parent | 27edc4907f17cbfd16cdd18241d6a936990006f5 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index a131fbd35..41bc3a4bd 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -297,7 +297,8 @@ sub redirect_or_confirm_creation : Private { =head2 signup_for_alerts If the user has selected to be signed up for alerts then create a -new_updates alert. +new_updates alert. Or if they're logged in and they've unticked the +box, disable their alert. NB: this does not check if they are a registered user so that should happen before calling this. @@ -317,8 +318,10 @@ sub signup_for_alerts : Private { cobrand_data => $update->cobrand_data, lang => $update->lang, ); - $alert->confirm(); + + } elsif ( $c->user && ( my $alert = $c->user->alert_for_problem($c->stash->{update}->problem_id) ) ) { + $alert->disable(); } return 1; |