From 3891b63a1eb52076337885487f251a10580a4a85 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 27 Apr 2016 18:50:13 +0200 Subject: Bug 218917 - Allow the login name to be different from the email address Original patch by Gervase Markham r=gerv a=dkl --- Bugzilla/API/1_0/Resource/Bug.pm | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'Bugzilla/API/1_0/Resource/Bug.pm') diff --git a/Bugzilla/API/1_0/Resource/Bug.pm b/Bugzilla/API/1_0/Resource/Bug.pm index 781ac3176..b0182a5e3 100644 --- a/Bugzilla/API/1_0/Resource/Bug.pm +++ b/Bugzilla/API/1_0/Resource/Bug.pm @@ -509,7 +509,7 @@ sub _translate_comment { my $comment_hash = { id => as_int($comment->id), bug_id => as_int($comment->bug_id), - creator => as_email($comment->author->login), + creator => as_login($comment->author->login), time => as_datetime($comment->creation_ts), creation_time => as_datetime($comment->creation_ts), is_private => as_boolean($comment->is_private), @@ -1431,7 +1431,7 @@ sub _bug_to_hash { $item{alias} = as_string_array($bug->alias); } if (filter_wants $params, 'assigned_to') { - $item{'assigned_to'} = as_email($bug->assigned_to->login); + $item{'assigned_to'} = as_login($bug->assigned_to->login); $item{'assigned_to_detail'} = $self->_user_to_hash($bug->assigned_to, $params, undef, 'assigned_to'); } if (filter_wants $params, 'blocks') { @@ -1444,14 +1444,14 @@ sub _bug_to_hash { $item{component} = as_string($bug->component); } if (filter_wants $params, 'cc') { - $item{'cc'} = as_email_array($bug->cc); + $item{'cc'} = as_login_array($bug->cc); $item{'cc_detail'} = [ map { $self->_user_to_hash($_, $params, undef, 'cc') } @{ $bug->cc_users } ]; } if (filter_wants $params, 'creation_time') { $item{'creation_time'} = as_datetime($bug->creation_ts); } if (filter_wants $params, 'creator') { - $item{'creator'} = as_email($bug->reporter->login); + $item{'creator'} = as_login($bug->reporter->login); $item{'creator_detail'} = $self->_user_to_hash($bug->reporter, $params, undef, 'creator'); } if (filter_wants $params, 'depends_on') { @@ -1477,7 +1477,7 @@ sub _bug_to_hash { } if (filter_wants $params, 'qa_contact') { my $qa_login = $bug->qa_contact ? $bug->qa_contact->login : ''; - $item{'qa_contact'} = as_email($qa_login); + $item{'qa_contact'} = as_login($qa_login); if ($bug->qa_contact) { $item{'qa_contact_detail'} = $self->_user_to_hash($bug->qa_contact, $params, undef, 'qa_contact'); } @@ -1546,8 +1546,7 @@ sub _user_to_hash { my $item = filter $filters, { id => as_int($user->id), real_name => as_string($user->name), - name => as_email($user->login), - email => as_email($user->email), + name => as_login($user->login), }, $types, $prefix; return $item; } @@ -1571,7 +1570,7 @@ sub _attachment_to_hash { # creator requires an extra lookup, so we only send them if # the filter wants them. if (filter_wants $filters, 'creator', $types, $prefix) { - $item->{'creator'} = as_email($attach->attacher->login); + $item->{'creator'} = as_login($attach->attacher->login); } if (filter_wants $filters, 'data', $types, $prefix) { @@ -1603,7 +1602,7 @@ sub _flag_to_hash { foreach my $field (qw(setter requestee)) { my $field_id = $field . "_id"; - $item->{$field} = as_email($flag->$field->login) + $item->{$field} = as_login($flag->$field->login) if $flag->$field_id; } @@ -2672,10 +2671,6 @@ C The 'real' name for this user, if any. C The user's Bugzilla login. -=item C - -C The user's email address. Currently this is the same value as the name. - =back =back -- cgit v1.2.3-24-g4f1b