Fix file formatting

pull/9/head
Thomas Sileo 2018-06-27 23:26:19 +02:00
rodzic 319241ebff
commit c4d490e310
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -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"]