diff options
author | Struan Donald <struan@exo.org.uk> | 2012-12-04 14:25:48 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-12-04 14:25:48 +0000 |
commit | 8e7b15a165ae0bc5a0afc42dd35635c53adf488e (patch) | |
tree | 18a8023c87ed8bf2e9768df89fcc6ac37be563d5 | |
parent | d15979ba78fe0c777c93b30b2dba7df72fee0abf (diff) |
allow cobrand to skip report confirmation
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 4b016ea5d..7d9e43d82 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -963,7 +963,10 @@ sub save_user_and_report : Private { my $report = $c->stash->{report}; # Save or update the user if appropriate - if ( !$report->user->in_storage ) { + if ( $c->cobrand->never_confirm_reports ) { + $report->user->update(); + $report->confirm(); + } elsif ( !$report->user->in_storage ) { # User does not exist. # Store changes in token for when token is validated. $c->stash->{token_data} = { diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 8f4f589f4..670e49469 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -758,5 +758,13 @@ sub report_check_for_errors { sub report_sent_confirmation_email { 0; } +=head2 never_confirm_reports + +If true then we never send an email to confirm a report + +=cut + +sub never_confirm_reports { 0; } + 1; |