diff options
author | Struan Donald <struan@exo.org.uk> | 2012-12-04 15:04:46 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-12-04 15:04:46 +0000 |
commit | 98701db851dc33462250e49152e02ced5deaebe0 (patch) | |
tree | 998a1037242986f51e1f7c0c6cf56e17ca924ed5 | |
parent | 8e7b15a165ae0bc5a0afc42dd35635c53adf488e (diff) |
if never confirming reports make sure we handle new users correctly
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 7d9e43d82..37a16e17f 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -964,7 +964,11 @@ sub save_user_and_report : Private { # Save or update the user if appropriate if ( $c->cobrand->never_confirm_reports ) { - $report->user->update(); + if ( $report->user->in_storage() ) { + $report->user->update(); + } else { + $report->user->insert(); + } $report->confirm(); } elsif ( !$report->user->in_storage ) { # User does not exist. |