Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
6b93b3f5
Verified
Commit
6b93b3f5
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Implement Person.member_of_recursive
parent
f722392a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!852
Resolve "Add recursive helper methods for Group"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/models.py
+8
-0
8 additions, 0 deletions
aleksis/core/models.py
with
8 additions
and
0 deletions
aleksis/core/models.py
+
8
−
0
View file @
6b93b3f5
...
...
@@ -300,6 +300,14 @@ class Person(ExtensibleModel):
user_info_tracker
=
FieldTracker
(
fields
=
(
"
first_name
"
,
"
last_name
"
,
"
email
"
))
@property
def
member_of_recursive
(
self
)
->
QuerySet
:
"""
Get all groups this person is a member of, recursively.
"""
q
=
self
.
member_of
for
group
in
q
.
all
():
q
=
q
.
union
(
group
.
parent_groups_recursive
)
return
q
def
save
(
self
,
*
args
,
**
kwargs
):
# Determine all fields that were changed since last load
dirty
=
self
.
pk
is
None
or
bool
(
self
.
user_info_tracker
.
changed
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment