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
faca6186
Commit
faca6186
authored
Jul 28, 2020
by
Fernando Ribeiro
Browse files
Feat: Change Eventviewset from readonly to ModelViewSet
parent
b29c2589
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
courses/classroom/models.py
courses/classroom/models.py
+1
-1
courses/classroom/views.py
courses/classroom/views.py
+5
-1
No files found.
courses/classroom/models.py
View file @
faca6186
...
...
@@ -12,7 +12,7 @@ class Classroom(models.Model):
max_length
=
255
,
)
description
=
models
.
TextField
(
_
(
'
Pronatec
'
),
_
(
'
description
'
),
blank
=
True
,
)
image
=
models
.
ImageField
(
...
...
courses/classroom/views.py
View file @
faca6186
...
...
@@ -13,12 +13,16 @@ from .serializers import (
from
.permissions
import
IsClassroomAssistantOrCoordinatorOrReadOnly
class
EventViewSet
(
viewsets
.
ReadOnly
ModelViewSet
):
class
EventViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Event
.
objects
.
all
()
serializer_class
=
EventSerializer
permission_classes
=
[
IsAuthenticated
]
def
get_queryset
(
self
):
queryset
=
super
().
get_queryset
()
return
queryset
class
BasicClassroomViewSet
(
viewsets
.
ReadOnlyModelViewSet
):
...
...
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