aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm18
1 files changed, 7 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 246facbee..4632f450d 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -426,26 +426,21 @@ sub initialize_report : Private {
for (1) { # use as pseudo flow control
- # did we find a token
- last unless $partial;
-
# is it in the database
my $token =
$c->model("DB::Token")
- ->find( { scope => 'partial', token => $partial } ) #
+ ->find( { scope => 'partial', token => $partial } )
|| last;
# can we get an id from it?
- my $id = $token->data #
- || last;
+ my $id = $token->data || last;
# load the related problem
- $report = $c->cobrand->problems #
- ->search( { id => $id, state => 'partial' } ) #
+ $report = $c->cobrand->problems
+ ->search( { id => $id, state => 'partial' } )
->first;
if ($report) {
-
# log the problem creation user in to the site
$c->authenticate( { email => $report->user->email },
'no_password' );
@@ -453,9 +448,10 @@ sub initialize_report : Private {
# save the token to delete at the end
$c->stash->{partial_token} = $token if $report;
- }
- else {
+ # Stash the photo IDs for "already got" display
+ $c->stash->{upload_fileid} = $report->get_photoset($c)->data;
+ } else {
# no point keeping it if it is done.
$token->delete;
}