Don't serialize if a view is explicitly set.
[catagits/Catalyst-Action-Serialize-Data-Serializer.git] / lib / Catalyst / Action / Serialize.pm
index be6dda5..bd9e09a 100644 (file)
@@ -26,6 +26,8 @@ sub execute {
     return 1 if $c->response->has_body;
     return 1 if scalar @{ $c->error };
     return 1 if $c->response->status =~ /^(?:204)$/;
+    return 1 if defined $c->stash->{current_view};
+    return 1 if defined $c->stash->{current_view_instance};
 
     my ( $sclass, $sarg, $content_type ) =
       $self->_load_content_plugins( "Catalyst::Action::Serialize",