kopia lustrzana https://github.com/tsileo/little-boxes
Fix file formatting
rodzic
319241ebff
commit
c4d490e310
|
@ -235,7 +235,9 @@ class BaseActivity(object, metaclass=_ActivityMeta):
|
|||
self.ACTIVITY_TYPE != ActivityType.CREATE and "id" not in obj
|
||||
):
|
||||
raise BadActivityError("invalid object, missing type")
|
||||
if not _has_type(obj["type"], self.ALLOWED_OBJECT_TYPES): # type: ignore # XXX: too complicated
|
||||
if not _has_type(
|
||||
obj["type"], self.ALLOWED_OBJECT_TYPES
|
||||
): # type: ignore # XXX: too complicated
|
||||
raise UnexpectedActivityTypeError(
|
||||
f'unexpected object type {obj["type"]} (allowed={self.ALLOWED_OBJECT_TYPES!r})'
|
||||
)
|
||||
|
@ -351,7 +353,9 @@ class BaseActivity(object, metaclass=_ActivityMeta):
|
|||
if not actor or "id" not in actor:
|
||||
raise BadActivityError(f"invalid actor {actor}")
|
||||
|
||||
if not _has_type(actor["type"], ACTOR_TYPES): # type: ignore # XXX: too complicated
|
||||
if not _has_type(
|
||||
actor["type"], ACTOR_TYPES
|
||||
): # type: ignore # XXX: too complicated
|
||||
raise UnexpectedActivityTypeError(f'actor has wrong type {actor["type"]!r}')
|
||||
|
||||
return actor["id"]
|
||||
|
|
Ładowanie…
Reference in New Issue