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
a0b8abcc
Commit
a0b8abcc
authored
May 18, 2021
by
Matheus Miranda
Browse files
Update user actions view
parent
6c6683f6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
courses/stats/serializers.py
courses/stats/serializers.py
+6
-6
courses/stats/views.py
courses/stats/views.py
+2
-2
No files found.
courses/stats/serializers.py
View file @
a0b8abcc
...
...
@@ -135,18 +135,18 @@ class ActionSerializer(serializers.ModelSerializer):
if
isinstance
(
obj
,
Card
):
if
verb
==
'reacted'
:
if
lang
==
'en'
:
topic
=
' to the content {}'
card
=
' to the content {}'
if
lang
==
'pt-br'
:
topic
=
' ao conteúdo {}'
card
=
' ao conteúdo {}'
if
lang
==
'es'
:
topic
=
' al contenido {}'
card
=
' al contenido {}'
else
:
if
lang
==
'en'
:
topic
=
' the content {}'
card
=
' the content {}'
if
lang
==
'pt-br'
:
topic
=
' o conteúdo {}'
card
=
' o conteúdo {}'
if
lang
==
'es'
:
topic
=
' el contenido {}'
card
=
' el contenido {}'
card
=
' o conteúdo {}'
return
card
.
format
(
obj
.
title
)
if
isinstance
(
obj
,
Unit
):
...
...
courses/stats/views.py
View file @
a0b8abcc
...
...
@@ -49,9 +49,9 @@ class UserActionsView(views.APIView):
# Get the actual model objects for action and target
action_object
=
None
target
=
None
if
'action_object_type'
in
data
:
if
'action_object_type'
in
data
and
'action_object_id'
in
data
:
action_object
=
allowed_models
[
data
[
'action_object_type'
]].
objects
.
get
(
id
=
data
[
'action_object_id'
])
if
'target_type'
in
data
:
if
'target_type'
in
data
and
'target_id'
in
data
:
target
=
allowed_models
[
data
[
'target_type'
]].
objects
.
get
(
id
=
data
[
'target_id'
])
# Save the action
...
...
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