Commit dd2f1afd authored by Glaucia S. Santos's avatar Glaucia S. Santos
Browse files

Fix to check if has unit empty

parent 6dd91cdd
...@@ -131,7 +131,7 @@ class ActionSerializer(serializers.ModelSerializer): ...@@ -131,7 +131,7 @@ class ActionSerializer(serializers.ModelSerializer):
def get_complements(self, obj): def get_complements(self, obj):
if obj.target: if obj.target:
if isinstance(obj.target, LearningObject): if isinstance(obj.target, LearningObject) and obj.target.unit:
unit = 'a atividade {}'.format(obj.target.unit.title) unit = 'a atividade {}'.format(obj.target.unit.title)
step = 'na etapa {}'.format(obj.target.unit.lesson.name) step = 'na etapa {}'.format(obj.target.unit.lesson.name)
course = 'do curso {}'.format(obj.target.unit.lesson.course.name) course = 'do curso {}'.format(obj.target.unit.lesson.course.name)
......
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