Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ec24e644
Commit
ec24e644
authored
Mar 22, 2022
by
Timo Furrer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor preloading users in REST API
parent
408abb79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lib/api/users.rb
lib/api/users.rb
+5
-3
No files found.
lib/api/users.rb
View file @
ec24e644
...
@@ -120,9 +120,11 @@ module API
...
@@ -120,9 +120,11 @@ module API
users
=
reorder_users
(
users
)
users
=
reorder_users
(
users
)
entity
=
current_user
&
.
admin?
?
Entities
::
UserWithAdmin
:
Entities
::
UserBasic
entity
=
current_user
&
.
admin?
?
Entities
::
UserWithAdmin
:
Entities
::
UserBasic
users
=
users
.
preload
(
:identities
,
:u2f_registrations
)
if
entity
==
Entities
::
UserWithAdmin
users
=
users
.
preload
(
:identities
,
:webauthn_registrations
)
if
entity
==
Entities
::
UserWithAdmin
if
entity
==
Entities
::
UserWithAdmin
users
=
users
.
preload
(
:namespace
)
if
entity
==
Entities
::
UserWithAdmin
users
=
users
.
preload
(
:identities
,
:u2f_registrations
,
:webauthn_registrations
,
:namespace
)
end
users
,
options
=
with_custom_attributes
(
users
,
{
with:
entity
,
current_user:
current_user
})
users
,
options
=
with_custom_attributes
(
users
,
{
with:
entity
,
current_user:
current_user
})
users
=
users
.
preload
(
:user_detail
)
users
=
users
.
preload
(
:user_detail
)
...
...
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