[bugzilla-gnome-org-upstream/4.4] Bug 1162334: email_enabled value inverted in User.update RPC call r=glob, a=glob



commit 42ae6d051450a6cfa4e80d1587881892f0157f64
Author: Jeff Fearn <Jeff Fearn gmail com>
Date:   Mon May 18 12:38:47 2015 +0800

    Bug 1162334: email_enabled value inverted in User.update RPC call
    r=glob,a=glob

 Bugzilla/User.pm            |    9 +++++++--
 Bugzilla/WebService/User.pm |    2 --
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 5d1c42a..89fa200 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -246,8 +246,9 @@ sub _check_is_enabled {
 # Mutators
 ################################################################################
 
-sub set_disable_mail { $_[0]->set('disable_mail', $_[1]); }
-sub set_extern_id    { $_[0]->set('extern_id', $_[1]); }
+sub set_disable_mail  { $_[0]->set('disable_mail', $_[1]); }
+sub set_email_enabled { $_[0]->set('disable_mail', !$_[1]); }
+sub set_extern_id     { $_[0]->set('extern_id', $_[1]); }
 
 sub set_login {
     my ($self, $login) = @_;
@@ -2600,6 +2601,10 @@ i.e. if the 'insidergroup' parameter is set and the user belongs to this group.
 Returns true if the user is a global watcher,
 i.e. if the 'globalwatchers' parameter contains the user.
 
+=item C<set_email_enabled>
+
+C<bool> - Sets C<disable_mail> to the inverse of the boolean provided.
+
 =back
 
 =head1 CLASS FUNCTIONS
diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm
index 5a7f250..469e5c5 100644
--- a/Bugzilla/WebService/User.pm
+++ b/Bugzilla/WebService/User.pm
@@ -45,14 +45,12 @@ use constant MAPPED_FIELDS => {
     email => 'login',
     full_name => 'name',
     login_denied_text => 'disabledtext',
-    email_enabled => 'disable_mail'
 };
 
 use constant MAPPED_RETURNS => {
     login_name => 'email',
     realname => 'full_name',
     disabledtext => 'login_denied_text',
-    disable_mail => 'email_enabled'
 };
 
 ##############


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]