[Jifty-commit] r1521 - jifty/trunk/lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Jul 10 14:04:24 EDT 2006
Author: clkao
Date: Mon Jul 10 14:04:15 2006
New Revision: 1521
Modified:
jifty/trunk/lib/Jifty/Action.pm
jifty/trunk/lib/Jifty/DateTime.pm
Log:
Reduce more duplicated calls.
Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm (original)
+++ jifty/trunk/lib/Jifty/Action.pm Mon Jul 10 14:04:15 2006
@@ -322,11 +322,9 @@
my $self = shift;
my $arg_name = shift;
- my $mode = (defined $self->arguments->{$arg_name}{'render_mode'}
- and $self->arguments->{$arg_name}{'render_mode'} eq 'read')
- ? 'read'
- : 'update';
-
+ my $mode = $self->arguments->{$arg_name}{'render_mode'};
+ $mode = 'update' unless $mode && $mode eq 'read';
+
$self->_form_widget( argument => $arg_name,
render_mode => $mode,
@_);
Modified: jifty/trunk/lib/Jifty/DateTime.pm
==============================================================================
--- jifty/trunk/lib/Jifty/DateTime.pm (original)
+++ jifty/trunk/lib/Jifty/DateTime.pm Mon Jul 10 14:04:15 2006
@@ -36,12 +36,13 @@
# we want to convert to the end-user's timezone. This is
# complicated by the fact that DateTime auto-appends
$self->_get_current_user();
- if ( $self->current_user->user_object
- and $self->current_user->user_object->can('time_zone')
- and $self->current_user->user_object->time_zone )
+ my $user_obj = $self->current_user->user_object;
+ if ( $user_obj
+ and $user_obj->can('time_zone')
+ and $user_obj->time_zone )
{
$self->set_time_zone("UTC");
- $self->set_time_zone( $self->current_user->user_object->time_zone );
+ $self->set_time_zone( $user_obj->time_zone );
}
return $self;
More information about the Jifty-commit
mailing list