Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Rex Dri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rex Dri
Rex Dri
Commits
30b5034c
Commit
30b5034c
authored
Mar 10, 2019
by
Florent Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #54
Make use of optimization trick for is_member
parent
6d7d3f44
Pipeline
#36188
passed with stages
in 4 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
backend/backend_app/utils/__is_member.py
backend/backend_app/utils/__is_member.py
+4
-1
No files found.
backend/backend_app/utils/__is_member.py
View file @
30b5034c
...
...
@@ -7,4 +7,7 @@ def is_member(group_name: str, user: User) -> bool:
TODO unit test
"""
return
user
.
groups
.
filter
(
name
=
group_name
).
exists
()
return
group_name
in
user
.
cached_groups
# before:
# When we were using the standard django model
# return user.groups.filter(name=group_name).exists()
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