Skip to content

Commit 2324df4

Browse files
authored
edit: classroom alert attr order (#418)
1 parent f388112 commit 2324df4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

scratchattach/site/alert.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,21 @@ class EducatorAlert:
3939
notification_type: not sure what this is for, but inferred from the scratch HTML reference
4040
"""
4141
_: KW_ONLY
42+
# required attrs
43+
target: user.User
44+
actor: user.User
45+
target_object: Optional[Union[project.Project, studio.Studio, comment.Comment, studio.Studio]]
46+
notification_type: str
47+
_session: Optional[session.Session]
48+
49+
# defaulted attrs
4250
model: str = "educators.educatoralert"
4351
type: int = -1
4452
raw: dict = field(repr=False, default_factory=dict)
4553
id: int = -1
4654
time_read: datetime = datetime.fromtimestamp(0.0)
4755
time_created: datetime = datetime.fromtimestamp(0.0)
48-
target: user.User
49-
actor: user.User
50-
target_object: Optional[Union[project.Project, studio.Studio, comment.Comment, studio.Studio]]
51-
notification_type: str
52-
_session: Optional[session.Session]
56+
5357

5458
@classmethod
5559
def from_json(cls, data: dict[str, Any], _session: Optional[session.Session] = None) -> Self:

0 commit comments

Comments
 (0)