kopia lustrzana https://github.com/snarfed/bridgy-fed
accept Undo of Follow even if Follower doesn't exist
rodzic
f02c212f37
commit
65044b081c
|
@ -214,12 +214,13 @@ class InboxHandler(webapp2.RequestHandler):
|
|||
# deactivate Follower
|
||||
user_domain = util.domain_from_link(followee)
|
||||
follower_obj = Follower.get_by_id(Follower._id(user_domain, follower))
|
||||
if not follower_obj:
|
||||
common.error(self, '%s has never followed %s' % (follower, user_domain))
|
||||
if follower_obj:
|
||||
logging.info('Marking %s as inactive' % follower_obj.key)
|
||||
follower_obj.status = 'inactive'
|
||||
follower_obj.put()
|
||||
else:
|
||||
logging.warning(self, 'No Follower found for %s %s' % (user_domain, follower))
|
||||
|
||||
logging.info('Marking %s as inactive' % follower_obj.key)
|
||||
follower_obj.status = 'inactive'
|
||||
follower_obj.put()
|
||||
|
||||
# TODO send webmention with 410 of u-follow
|
||||
|
||||
|
|
|
@ -375,8 +375,7 @@ class ActivityPubTest(testutil.TestCase):
|
|||
|
||||
got = app.get_response('/foo.com/inbox', method='POST',
|
||||
body=json.dumps(UNDO_FOLLOW_WRAPPED))
|
||||
self.assertEquals(400, got.status_int)
|
||||
self.assertIn('has never followed realize.be', got.text)
|
||||
self.assertEquals(200, got.status_int)
|
||||
|
||||
def test_inbox_undo_follow_inactive(self, mock_head, mock_get, mock_post):
|
||||
mock_head.return_value = requests_response(url='https://realize.be/')
|
||||
|
|
Ładowanie…
Reference in New Issue