Skip to content

Commit

Permalink
Make GroupActivity.role optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonxslays committed Oct 25, 2023
1 parent feeea96 commit 6685c42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wom/models/groups/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ class GroupActivity(BaseModel):
type: GroupActivityType
"""The type of activity that occurred."""

role: GroupRole
"""The players role in the group."""
role: t.Optional[GroupRole]
"""The players role in the group, if they have one."""

created_at: datetime
"""The datetime indicating when this activity occurred."""
Expand Down
2 changes: 1 addition & 1 deletion wom/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ def deserialize_group_activity(self, data: DictT) -> models.GroupActivity:
The requested model.
"""
activity = models.GroupActivity()
activity.role = models.GroupRole.from_str(data["role"])
activity.role = models.GroupRole.from_str_maybe(data["role"])
activity.player = self.deserialize_player(data["player"])
activity.created_at = self._dt_from_iso(data["createdAt"])
activity.type = models.GroupActivityType.from_str(data["type"])
Expand Down

0 comments on commit 6685c42

Please sign in to comment.