Tweak webmention processing

This commit is contained in:
Thomas Sileo 2022-11-20 11:31:00 +01:00
parent 4c6eb51ae2
commit d692ec060f
2 changed files with 24 additions and 15 deletions

View file

@ -8,7 +8,6 @@ from loguru import logger
from app import media
from app.models import InboxObject
from app.models import Webmention
from app.models import WebmentionType
from app.utils.datetime import parse_isoformat
from app.utils.url import make_abs
@ -129,9 +128,6 @@ class WebmentionReply:
@classmethod
def from_webmention(cls, webmention: Webmention) -> Optional["WebmentionReply"]:
if webmention.webmention_type != WebmentionType.REPLY:
raise ValueError(f"Unexpected webmention {webmention.id}")
items = webmention.source_microformats.get("items", []) # type: ignore
for item in items:
if item["type"][0] == "h-entry":