Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
8679e81c
Commit
8679e81c
authored
Feb 06, 2014
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 967607: User.get shouldn't load data that requires extra database queries unless required
r=dkl, a=justdave
parent
eae63571
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
User.pm
Bugzilla/WebService/User.pm
+17
-7
No files found.
Bugzilla/WebService/User.pm
View file @
8679e81c
...
...
@@ -17,7 +17,7 @@ use Bugzilla::Error;
use
Bugzilla::
Group
;
use
Bugzilla::
User
;
use
Bugzilla::
Util
qw(trim)
;
use
Bugzilla::WebService::
Util
qw(filter validate translate params_to_objects)
;
use
Bugzilla::WebService::
Util
qw(filter
filter_wants
validate translate params_to_objects)
;
use
List::
Util
qw(first)
;
...
...
@@ -226,9 +226,7 @@ sub get {
}
}
my
$in_group
=
$self
->
_filter_users_by_group
(
\
@user_objects
,
$params
);
my
$in_group
=
$self
->
_filter_users_by_group
(
\
@user_objects
,
$params
);
foreach
my
$user
(
@$in_group
)
{
my
$user_info
=
{
id
=>
$self
->
type
(
'int'
,
$user
->
id
),
...
...
@@ -244,16 +242,28 @@ sub get {
}
if
(
Bugzilla
->
user
->
id
==
$user
->
id
)
{
$user_info
->
{
saved_searches
}
=
[
map
{
$self
->
_query_to_hash
(
$_
)
}
@
{
$user
->
queries
}];
$user_info
->
{
saved_reports
}
=
[
map
{
$self
->
_report_to_hash
(
$_
)
}
@
{
$user
->
reports
}];
if
(
filter_wants
(
$params
,
'saved_searches'
))
{
$user_info
->
{
saved_searches
}
=
[
map
{
$self
->
_query_to_hash
(
$_
)
}
@
{
$user
->
queries
}
];
}
if
(
filter_wants
(
$params
,
'saved_reports'
))
{
$user_info
->
{
saved_reports
}
=
[
map
{
$self
->
_report_to_hash
(
$_
)
}
@
{
$user
->
reports
}
];
}
}
if
(
filter_wants
(
$params
,
'groups'
))
{
if
(
Bugzilla
->
user
->
id
==
$user
->
id
||
Bugzilla
->
user
->
in_group
(
'editusers'
))
{
$user_info
->
{
groups
}
=
[
map
{
$self
->
_group_to_hash
(
$_
)}
@
{
$user
->
groups
}];
$user_info
->
{
groups
}
=
[
map
{
$self
->
_group_to_hash
(
$_
)
}
@
{
$user
->
groups
}
];
}
else
{
$user_info
->
{
groups
}
=
$self
->
_filter_bless_groups
(
$user
->
groups
);
}
}
push
(
@users
,
filter
(
$params
,
$user_info
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment