[Jifty-commit] r5163 - in jifty/trunk: lib/Jifty/Action/Record
Jifty commits
jifty-commit at lists.jifty.org
Fri Feb 22 17:31:02 EST 2008
Author: sartak
Date: Fri Feb 22 17:31:01 2008
New Revision: 5163
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Action/Record/Delete.pm
jifty/trunk/lib/Jifty/Action/Record/Update.pm
Log:
r52015 at onn: sartak | 2008-02-22 17:30:46 -0500
In Action::Record::Delete and ::Update, don't require that error messages be returned from set_field and delete. This is to facilitate before_$crud JDBI::Record triggers
Modified: jifty/trunk/lib/Jifty/Action/Record/Delete.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record/Delete.pm (original)
+++ jifty/trunk/lib/Jifty/Action/Record/Delete.pm Fri Feb 22 17:31:01 2008
@@ -58,7 +58,7 @@
# Delete the record and return an error if delete fails
my ( $val, $msg ) = $self->record->delete;
- $self->result->error($msg) if not $val and $msg;
+ $self->result->error($msg || _('Permission denied')) if not $val;
# Otherwise, we seem to have succeeded, report that
$self->report_success if not $self->result->failure;
Modified: jifty/trunk/lib/Jifty/Action/Record/Update.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record/Update.pm (original)
+++ jifty/trunk/lib/Jifty/Action/Record/Update.pm Fri Feb 22 17:31:01 2008
@@ -175,8 +175,8 @@
# Calculate the name of the setter and set; asplode on failure
my $setter = "set_$field";
my ( $val, $msg ) = $self->record->$setter( $value );
- $self->result->field_error($field, $msg)
- if not $val and $msg;
+ $self->result->field_error($field, $msg || _('Permission denied'))
+ if not $val;
# Remember that we changed something (if we did)
$changed = 1 if $val;
More information about the Jifty-commit
mailing list