Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
f5e5c569
Commit
f5e5c569
authored
Apr 13, 2021
by
Glaucia Schnoeller dos Santos
Browse files
Merge branch 'develop' into 'master'
Change course permission for all users See merge request
!46
parents
c78ea6dd
e1c70fa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
courses/views.py
courses/views.py
+6
-5
No files found.
courses/views.py
View file @
f5e5c569
...
...
@@ -63,11 +63,12 @@ class CourseViewSet(viewsets.ModelViewSet):
).
prefetch_related
(
'professors'
)
# Course must have status status published and (be public or share groups with user)
query
=
Q
(
Q
(
status
=
'published'
)
&
(
Q
(
is_public
=
True
,
)
|
Q
(
groups__in
=
self
.
request
.
user
.
groups
.
all
(),
status
=
'published'
)
)
)
#query = Q(
# Q(status='published') & (
# Q(is_public=True, ) | Q(groups__in=self.request.user.groups.all(), status='published')
# )
#)
query
=
Q
(
status
=
'published'
)
if
(
CourseProfessor
.
objects
.
filter
(
user
=
self
.
request
.
user
,
role
=
'coordinator'
).
exists
()):
query
.
add
(
Q
(
...
...
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