aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm7
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;