Merge branch '787-broken-follow' into 'develop'

Fix #787: federation issue due to missing error handling

Closes #787

See merge request funkwhale/funkwhale!706
This commit is contained in:
Eliot Berriot 2019-04-05 16:25:37 +02:00
commit 156d9c813a
2 changed files with 6 additions and 1 deletions

View File

@ -388,7 +388,7 @@ def recursive_getattr(obj, key, permissive=False):
def match_route(route, payload):
for key, value in route.items():
payload_value = recursive_getattr(payload, key)
payload_value = recursive_getattr(payload, key, permissive=True)
if payload_value != value:
return False

View File

@ -91,6 +91,11 @@ def test_receive_skips_if_no_matching_route(factories, now, mocker):
assert models.Activity.objects.count() == 0
def test_match_route_ignore_payload_issues():
payload = {"object": "http://hello"}
assert activity.match_route({"object.type": "Test"}, payload) is False
@pytest.mark.parametrize(
"params, policy_kwargs, expected",
[