aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm8
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf9b222b3..d56976aec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@
- Only save category changes if staff user update valid #1857
- Only create one update when staff user updating category #1857
- Do not include blank updates in email alerts #1857
+ - Redirect inspectors correctly on creation in two-tier.
- Admin improvements:
- Character length limit can be placed on report detailed information #1848
- Inspector panel shows nearest address if available #1850
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 5f36443c0..7f1de3ed4 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1362,9 +1362,13 @@ sub redirect_or_confirm_creation : Private {
to => [ [ $report->user->email, $report->name ] ],
} );
}
- if ($c->user_exists && $c->user->has_body_permission_to('planned_reports')) {
+ # If the user has shortlist permission, and either we're not on a
+ # council cobrand or the just-created problem is owned by the cobrand
+ # (so we'll stay on-cobrand), redirect to the problem.
+ if ($c->user_exists && $c->user->has_body_permission_to('planned_reports') &&
+ (!$c->cobrand->is_council || $c->cobrand->owns_problem($report))) {
$c->log->info($report->user->id . ' is an inspector - redirecting straight to report page for ' . $report->id);
- $c->res->redirect( '/report/'. $report->id );
+ $c->res->redirect( $report->url );
} else {
$c->log->info($report->user->id . ' was logged in, showing confirmation page for ' . $report->id);
$c->stash->{created_report} = 'loggedin';