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
bc9cb134
Commit
bc9cb134
authored
Oct 12, 2020
by
Matheus Miranda
Browse files
Modify topics count
parent
e67e5852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
courses/reports/serializers.py
courses/reports/serializers.py
+1
-1
No files found.
courses/reports/serializers.py
View file @
bc9cb134
...
...
@@ -156,7 +156,7 @@ class UserStatsSerializer(serializers.ModelSerializer):
return
obj
.
actor_actions
.
filter
(
verb
=
'access'
,
timestamp__gte
=
time_delta
).
count
()
def
get_topics
(
self
,
obj
):
return
Topic
.
objects
.
filter
(
author
=
obj
).
count
()
return
Topic
.
objects
.
filter
(
author
=
obj
).
exclude
(
forum__forum_type
=
'activity'
).
count
()
def
get_reactions
(
self
,
obj
):
return
TopicLike
.
objects
.
filter
(
user
=
obj
).
count
()
+
CommentLike
.
objects
.
filter
(
user
=
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