diff --git a/h/services/mention.py b/h/services/mention.py index 512508cf571..6d5e3bcc528 100644 --- a/h/services/mention.py +++ b/h/services/mention.py @@ -33,7 +33,9 @@ def update_mentions(self, annotation: Annotation) -> None: if mentioning_user.nipsa: return - mentioned_userids = OrderedDict.fromkeys(self._parse_userids(annotation.text)).keys() + mentioned_userids = OrderedDict.fromkeys( + self._parse_userids(annotation.text) + ).keys() mentioned_users = self._user_service.fetch_all(mentioned_userids) self._session.execute( delete(Mention).where(Mention.annotation_id == annotation.id) diff --git a/tests/unit/h/services/mention_test.py b/tests/unit/h/services/mention_test.py index 30336820762..0f894be8f7b 100644 --- a/tests/unit/h/services/mention_test.py +++ b/tests/unit/h/services/mention_test.py @@ -68,7 +68,9 @@ def test_update_mentions_with_private_annotation(self, service, annotation): assert len(annotation.mentions) == 0 - def test_update_mentions_with_own_mention(self, service, annotation, user_service, mentioning_user): + def test_update_mentions_with_own_mention( + self, service, annotation, user_service, mentioning_user + ): user_service.fetch_all.return_value = [mentioning_user] service.update_mentions(annotation)