Skip to content

Commit

Permalink
add cohort to user me task serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomm19 committed Nov 15, 2024
1 parent 039a8c1 commit 1e85dbd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions breathecode/assignments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class TaskGETSerializer(serpy.Serializer):
user = UserSmallSerializer()
opened_at = serpy.Field()
delivered_at = serpy.Field()
cohort = CohortSmallSerializer(required=False)
assignment_telemetry = serpy.MethodField()

created_at = serpy.Field()
Expand Down
1 change: 1 addition & 0 deletions breathecode/assignments/tests/urls/tests_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def get_serializer(self, task, user):
"opened_at": self.bc.datetime.to_iso_string(task.opened_at) if task.opened_at else task.opened_at,
"delivered_at": self.bc.datetime.to_iso_string(task.delivered_at) if task.delivered_at else task.delivered_at,
"user": {"first_name": user.first_name, "id": user.id, "last_name": user.last_name},
"cohort": {"id": task.cohort.id, "name": task.cohort.name, "slug": task.cohort.slug},
}


Expand Down
1 change: 1 addition & 0 deletions breathecode/assignments/tests/urls/tests_task_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def get_serializer(self, task, user):
"opened_at": self.bc.datetime.to_iso_string(task.opened_at) if task.opened_at else task.opened_at,
"delivered_at": self.bc.datetime.to_iso_string(task.delivered_at) if task.delivered_at else task.delivered_at,
"user": {"first_name": user.first_name, "id": user.id, "last_name": user.last_name},
"cohort": {"id": task.cohort.id, "name": task.cohort.name, "slug": task.cohort.slug},
}


Expand Down
1 change: 1 addition & 0 deletions breathecode/assignments/tests/urls/tests_user_me_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def get_serializer(self, task, user):
"opened_at": self.bc.datetime.to_iso_string(task.opened_at) if task.opened_at else task.opened_at,
"delivered_at": self.bc.datetime.to_iso_string(task.delivered_at) if task.delivered_at else task.delivered_at,
"user": {"first_name": user.first_name, "id": user.id, "last_name": user.last_name},
"cohort": {"id": task.cohort.id, "name": task.cohort.name, "slug": task.cohort.slug},
}


Expand Down

0 comments on commit 1e85dbd

Please sign in to comment.