mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
Fixes call to mention_users
This commit is contained in:
parent
c7c975d695
commit
ff721896c0
2 changed files with 11 additions and 2 deletions
|
@ -121,10 +121,11 @@ class ActivitypubMixin:
|
|||
# or maybe the thing itself is a user
|
||||
user = self
|
||||
# find anyone who's tagged in a status, for example
|
||||
mentions = self.mention_users if hasattr(self, 'mention_users') else []
|
||||
mentions = self.mention_users.all() if \
|
||||
hasattr(self, 'mention_users') else []
|
||||
|
||||
# we always send activities to explicitly mentioned users' inboxes
|
||||
recipients = [u.inbox for u in mentions.all() or []]
|
||||
recipients = [u.inbox for u in mentions or []]
|
||||
|
||||
# unless it's a dm, all the followers should receive the activity
|
||||
if privacy != 'direct':
|
||||
|
|
|
@ -88,6 +88,14 @@ class ActivitypubMixins(TestCase):
|
|||
self.assertEqual(result, book)
|
||||
|
||||
|
||||
def test_get_recipients(self):
|
||||
''' determines the recipients for a broadcast '''
|
||||
MockSelf = namedtuple('Self', ('privacy'))
|
||||
mock_self = MockSelf('public')
|
||||
ActivitypubMixin.get_recipients(mock_self)
|
||||
|
||||
|
||||
|
||||
# ObjectMixin
|
||||
def test_to_create_activity(self):
|
||||
''' wrapper for ActivityPub "create" action '''
|
||||
|
|
Loading…
Reference in a new issue