Commit a0b8abcc authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Update user actions view

parent 6c6683f6
......@@ -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):
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment