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
9cf0ba63
Commit
9cf0ba63
authored
Sep 25, 2020
by
Matheus Miranda
Browse files
Remove groups info from UserStatsSerializer
parent
286eadfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
courses/reports/serializers.py
courses/reports/serializers.py
+2
-4
No files found.
courses/reports/serializers.py
View file @
9cf0ba63
...
...
@@ -140,9 +140,8 @@ class UserStatsSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
User
fields
=
(
'name'
,
'username'
,
'email'
,
'id'
,
'image'
,
'groups'
,
'last_access'
,
'accesses_count'
,
'topics'
,
'reactions'
,
'comments'
)
fields
=
(
'name'
,
'username'
,
'email'
,
'id'
,
'image'
,
'last_access'
,
'accesses_count'
,
'topics'
,
'reactions'
,
'comments'
)
def
get_last_access
(
self
,
obj
):
count
=
obj
.
actor_actions
.
count
()
...
...
@@ -160,4 +159,3 @@ class UserStatsSerializer(serializers.ModelSerializer):
def
get_comments
(
self
,
obj
):
return
Comment
.
objects
.
filter
(
author
=
obj
).
count
()
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