sub process {
my ($class, $r) = @_;
my $method = $r->action;
- $r->{template} ||= $method; # Authentication may have done this for us
- $r->objects([ $class->retrieve(shift @{$r->{args}}) ]);
-
- # This allows the authentication mechanism to set the template
- # without needing to define an action.
- $class->$method($r) if $class->can($method);
+ return if $r->{template}; # Authentication has set this, we're done.
+
+ $r->{template} = $method;
+ my $obj = $class->retrieve( $r->{args}->[0] );
+ if ($obj) {
+ $r->objects([ $obj ]);
+ shift @{$r->{args}};
+ }
+ $class->$method($r);
}
sub display_columns {