X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=blobdiff_plain;f=lib%2FMaypole.pm;fp=lib%2FMaypole.pm;h=249a3e9a604c874846bf9ad56030c2fc1888efce;hp=8e24f8a8f13c0aeeb7ecee8d606a270b85309901;hb=83f49b1a6dd37085046213013288504696d5483e;hpb=536c18508012a66ca800394935bb4d408ec11b97 diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 8e24f8a..249a3e9 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -573,14 +573,17 @@ sub handler_guts { # We run additional_data for every request $self->additional_data; + # process request with model if applicable and template not set. if ($applicable) { - eval { $self->model_class->process($self) }; - if ( my $error = $@ ) { - $status = $self->call_exception($error, "model"); - if ( $status != OK ) { - $self->warn("caught model error: $error"); - return $self->debug ? - $self->view_object->error($self, $error) : ERROR; + unless ($r->{template}) { + eval { $self->model_class->process($self) }; + if ( my $error = $@ ) { + $status = $self->call_exception($error, "model"); + if ( $status != OK ) { + $self->warn("caught model error: $error"); + return $self->debug ? + $self->view_object->error($self, $error) : ERROR; + } } } } else {