]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
removed CGI::Untaint::Maypole, 29 tests now passing
[maypole.git] / lib / Maypole.pm
index 858c1eb608aa1dfa264b5e1206dedbad78399e9a..7b17858b849ffdd4fa9c63374e09ee215db0df07 100644 (file)
@@ -562,18 +562,13 @@ sub handler_guts
 
     my $applicable = $self->is_model_applicable == OK;
 
-    warn "applicable : $applicable";
-
-    $self->__setup_plain_template unless $applicable;
-
     my $status;
 
+    # handle authentication
     eval { $status = $self->call_authenticate };
-    
     if ( my $error = $@ ) 
     {
         $status = $self->call_exception($error, "authentication");
-        
         if ( $status != OK ) 
         {
             warn "caught authenticate error: $error";
@@ -581,7 +576,6 @@ sub handler_guts
                     $self->view_object->error($self, $error) : ERROR;
         }
     }
-    
     if ( $self->debug and $status != OK and $status != DECLINED ) 
     {
         $self->view_object->error( $self,
@@ -592,40 +586,32 @@ sub handler_guts
 
     # We run additional_data for every request
     $self->additional_data;
-    
-    if ($applicable) 
-    {
-        eval { $self->model_class->process($self) };
-        
-        if ( my $error = $@ ) 
+
+    if ($applicable) {
+      eval { $self->model_class->process($self) };
+      if ( my $error = $@ ) 
         {
-            $status = $self->call_exception($error, "model");
-            
-            if ( $status != OK ) 
+         $status = $self->call_exception($error, "model");
+         if ( $status != OK ) 
             {
-                warn "caught model error: $error";
-                return $self->debug ? 
-                    $self->view_object->error($self, $error) : ERROR;
+             warn "caught model error: $error";
+             return $self->debug ? 
+               $self->view_object->error($self, $error) : ERROR;
             }
         }
+    } else {
+      $self->__setup_plain_template;
     }
-    
+
     # less frequent path - perhaps output has been set to an error message
     return OK if $self->output;
-#    warn "output before processing view : ", $self->output;
 
     # normal path - no output has been generated yet
     my $processed_view_ok = $self->__call_process_view;
 
-    warn "output after processing view : ", $self->output;
-
-    warn "error after processing view : ", $self->{error};
-
     $self->{content_type}      ||= $self->__get_mime_type();
     $self->{document_encoding} ||= "utf-8";
 
-    warn "made it to end, processed_view_ok : $processed_view_ok";
 
     return $processed_view_ok;
 }
@@ -663,7 +649,7 @@ sub __load_request_model
 sub __setup_plain_template
 {
     my ($self) = @_;
-    
+
     # It's just a plain template
     $self->model_class(undef);