aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Default.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-12-03 11:55:14 +0000
committerStruan Donald <struan@exo.org.uk>2012-12-03 17:49:11 +0000
commitd17fadea1c8eaaed02cd82106e93b83fd74515be (patch)
tree8b0470316104f0a758ea3cc44f76cee7067c110f /perllib/FixMyStreet/Cobrand/Default.pm
parent59b4cd804cf9134f830109bfc51fba3856a21ea3 (diff)
move new report validation out to cobrand so we can over-ride this for
special cases without hard coding it into controller
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index cc8f6c526..0401f58c3 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -739,5 +739,22 @@ until the contacts/area/body handling is rewritten to be better.
sub reports_by_body { 0; }
+=head2 report_check_for_errors
+
+Perform validation for new reports. Takes Catalyst context object as an argument
+
+=cut
+
+sub report_check_for_errors {
+ my $self = shift;
+ my $c = shift;
+
+ return (
+ %{ $c->stash->{field_errors} },
+ %{ $c->stash->{report}->user->check_for_errors },
+ %{ $c->stash->{report}->check_for_errors },
+ );
+}
+
1;