X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=325380e62a2bea70e9be0cec5f504691c25403e5;hb=001396d36374c7060ecadea754bf3862eaf75635;hp=8e24f8a8f13c0aeeb7ecee8d606a270b85309901;hpb=ce73ea8b848572d33ad852e6b37f1c59ec5f9fc1;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 8e24f8a..325380e 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 ($self->{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 {