remove any_ from has_permissions

we branch on any_ to either say "require ALL these permissions" or
"require ANY of these permissions". But we only ever call the decorator
with one permission, or with any_=True, so it's unnecessary
This commit is contained in:
Leo Hemsted
2018-03-01 10:37:55 +00:00
parent 4a08cf81e7
commit 3afc193624
8 changed files with 12 additions and 18 deletions

View File

@@ -70,8 +70,7 @@ def test_user_has_permissions_or(
client,
user,
['send_messages', 'manage_service'],
True,
kwargs={'any_': True})
True)
def test_user_has_permissions_multiple(

View File

@@ -1931,7 +1931,7 @@ def mock_no_inbound_number_for_service(mocker):
@pytest.fixture(scope='function')
def mock_has_permissions(mocker):
def _has_permission(*permissions, any_=False, restrict_admin_usage=False):
def _has_permission(*permissions, restrict_admin_usage=False):
return True
return mocker.patch(