Fix the mention check helper

pull/15/head
Thomas Sileo 2018-09-03 08:54:30 +02:00
rodzic 27fbf34189
commit 61eb998797
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -859,9 +859,12 @@ class Note(BaseActivity):
def has_mention(self, actor_id: str) -> bool:
if self.tag is not None:
for tag in self.tag:
if tag["type"] == ActivityType.MENTION.value:
if tag["href"] == actor_id:
return True
try:
if tag["type"] == ActivityType.MENTION.value:
if tag["href"] == actor_id:
return True
except Exception:
logger.exception(f"invalid tag {tag!r}")
return False