Skip to content

Commit 8647242

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent fd1adaf commit 8647242

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/apmodel/core/object.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323
class Object(ActivityPubModel):
2424
context: LDContext = Field(
25-
default_factory=lambda: LDContext(
26-
["https://www.w3.org/ns/activitystreams"]
27-
),
25+
default_factory=lambda: LDContext(["https://www.w3.org/ns/activitystreams"]),
2826
kw_only=True,
2927
alias="@context",
3028
)
@@ -36,12 +34,10 @@ class Object(ActivityPubModel):
3634
url: Optional["str | Link"] = Field(default=None)
3735
published: Optional[str] = Field(default=None)
3836
updated: Optional[str] = Field(default=None)
39-
attributed_to: Optional["str | Actor | List[str | Actor]"] = Field(
37+
attributed_to: Optional["str | Actor | List[str | Actor]"] = Field(default=None)
38+
audience: Optional["str | Object | Dict[str, Any] | List[str | Object]"] = Field(
4039
default=None
4140
)
42-
audience: Optional["str | Object | Dict[str, Any] | List[str | Object]"] = (
43-
Field(default=None)
44-
)
4541
to: Optional[
4642
"str | Object | Dict[str, Any] | List[str | Object | Dict[str, Any]]"
4743
] = Field(default=None)
@@ -64,9 +60,7 @@ class Object(ActivityPubModel):
6460
likes: Optional["Collection"] = Field(default=None)
6561
shares: Optional["Collection"] = Field(default=None)
6662
scope: "Optional[Object | Dict[str, Any]]" = Field(default=None)
67-
tag: "List[Object | Hashtag | Emoji | Dict[str, Any]]" = Field(
68-
default_factory=list
69-
)
63+
tag: "List[Object | Hashtag | Emoji | Dict[str, Any]]" = Field(default_factory=list)
7064
attachment: "List[PropertyValue | Dict[str, Any] | Object | Link]" = Field(
7165
default_factory=list
7266
)
@@ -77,9 +71,7 @@ def _convert_field_to_model(cls, v: Any, info: ValidationInfo) -> Any:
7771

7872
if v is None:
7973
return None
80-
parent_context = (
81-
info.context.get("ld_context") if info.context else None
82-
)
74+
parent_context = info.context.get("ld_context") if info.context else None
8375
return load(v, "raw", parent_context=parent_context)
8476

8577
@field_validator(

0 commit comments

Comments
 (0)