aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-10-10 17:22:04 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-10-10 17:22:04 +0100
commitf058885277b593c2e866cf251177fe2d70207edb (patch)
treef46d3580ea59489f5a3c21a5f80db020ff16d5b5 /perllib/FixMyStreet/App/Controller/Report/New.pm
parent5eb4f4e746283b4e945b52745503baa4da4f345f (diff)
Stop warnings if org is not provided.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 1e6a3a088..1b023acc3 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -874,6 +874,16 @@ sub save_user_and_report : Private {
# Save or update the user if appropriate
if ( !$report->user->in_storage ) {
+ # User does not exist.
+ # Store changes in token for when token is validated.
+ $c->stash->{token_data} = {
+ name => $report->user->name,
+ phone => $report->user->phone,
+ password => $report->user->password,
+ };
+ $report->user->name( undef );
+ $report->user->phone( undef );
+ $report->user->password( '', 1 );
$report->user->insert();
}
elsif ( $c->user && $report->user->id == $c->user->id ) {