Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
FAST
project
fast-project-list
Commits
2ca02fb9
Commit
2ca02fb9
authored
Jul 13, 2021
by
Mirko Vucicevich
Browse files
Added distinct to project filter
parent
84d809b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
projector/models/projects.py
projector/models/projects.py
+1
-1
No files found.
projector/models/projects.py
View file @
2ca02fb9
...
...
@@ -25,7 +25,7 @@ def make_api_key():
class
ProjectManagerQS
(
models
.
QuerySet
):
def
by_user
(
self
,
user
):
return
self
.
filter
(
models
.
Q
(
author
=
user
)
|
models
.
Q
(
groups__users
=
user
)
|
models
.
Q
(
fallback__user
=
user
))
return
self
.
filter
(
models
.
Q
(
author
=
user
)
|
models
.
Q
(
groups__users
=
user
)
|
models
.
Q
(
fallback__user
=
user
))
.
distinct
()
class
Project
(
models
.
Model
):
objects
=
models
.
Manager
.
from_queryset
(
ProjectManagerQS
)()
...
...
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