Skip to content
Snippets Groups Projects
Commit 15eac69d authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '743-unfollow-notification' into 'master'

Fix #743: Do not send notification when rejecting a follow on a local library

See merge request funkwhale/funkwhale!649
parents fdcab5d2 3d94eddc
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,8 @@ from . import utils
def update_follow(follow, approved):
follow.approved = approved
follow.save(update_fields=["approved"])
routes.outbox.dispatch({"type": "Accept"}, context={"follow": follow})
if approved:
routes.outbox.dispatch({"type": "Accept"}, context={"follow": follow})
class LibraryFollowViewSet(
......
......@@ -123,9 +123,12 @@ def test_user_can_accept_or_reject_own_follows(
assert follow.approved is expected
mocked_dispatch.assert_called_once_with(
{"type": "Accept"}, context={"follow": follow}
)
if action == "accept":
mocked_dispatch.assert_called_once_with(
{"type": "Accept"}, context={"follow": follow}
)
if action == "reject":
mocked_dispatch.assert_not_called()
def test_user_can_list_inbox_items(factories, logged_in_api_client):
......
Do not send notification when rejecting a follow on a local library (#743)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment