Ignore unknown tag type in incoming post, rather than raise exception (#639)

pull/641/head
Henri Dickson 2023-08-25 18:35:57 -04:00 zatwierdzone przez GitHub
rodzic b003af64cc
commit 555046ac4d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -909,13 +909,11 @@ class Post(StatorModel):
elif tag_type in ["toot:emoji", "emoji"]:
emoji = Emoji.by_ap_tag(post.author.domain, tag, create=True)
post.emojis.add(emoji)
elif tag_type == "edition":
# Bookwyrm Edition is similar to hashtags. There should be a link to
# the book in the Note's content and a post attachment of the cover
# image. No special processing should be needed for ingest.
pass
else:
raise ValueError(f"Unknown tag type {tag['type']}")
# Various ActivityPub implementations and proposals introduced tag
# types, e.g. Edition in Bookwyrm and Link in fep-e232 Object Links
# it should be safe to ignore (and log) them before a full support
pass
# Visibility and to
# (a post is public if it's to:public, otherwise it's unlisted if
# it's cc:public, otherwise it's more limited)