Skip to content

Commit

Permalink
add cohort id to invite serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomm19 committed Oct 23, 2024
1 parent 8e0a556 commit 2a67c26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions breathecode/authenticate/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class CohortTinySerializer(serpy.Serializer):
"""The serializer schema definition."""

# Use a Field subclass like IntField if you need more validation.
id = serpy.Field()
slug = serpy.Field()
name = serpy.Field()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def generate_user_invite(self, model, user_invite, arguments={}):
"logo_url": model.academy.logo_url,
},
"cohort": {
"id": model.cohort.id,
"name": model.cohort.name,
"slug": model.cohort.slug,
},
Expand Down Expand Up @@ -362,6 +363,7 @@ def test_resend_invite_with_invitation(self):
},
"role": {"id": "potato", "name": "potato", "slug": "potato"},
"cohort": {
"id": model["cohort"].id,
"slug": model["cohort"].slug,
"name": model["cohort"].name,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def generate_user_invite(self, model, user_invite, arguments={}):
"logo_url": model.academy.logo_url,
},
"cohort": {
"id": model.cohort.id,
"name": model.cohort.name,
"slug": model.cohort.slug,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def generate_user_invite(self, model, user_invite, arguments={}):
"logo_url": model.academy.logo_url,
},
"cohort": {
"id": model.cohort.id,
"name": model.cohort.name,
"slug": model.cohort.slug,
},
Expand Down Expand Up @@ -393,6 +394,7 @@ def test_resend_invite_with_invitation(self):
},
"role": {"id": "potato", "name": "potato", "slug": "potato"},
"cohort": {
"id": model["cohort"].id,
"slug": model["cohort"].slug,
"name": model["cohort"].name,
},
Expand Down

0 comments on commit 2a67c26

Please sign in to comment.