Reject invalid optional access callbacks
This commit is contained in:
@@ -47,6 +47,8 @@ def test_regular_followup_checks_access_and_suppression(client):
|
||||
assert client.get('/cama/seguimiento?corte=2026-10-20&birads=BIRADS_4', headers=headers).status_code == 403
|
||||
assert client.get('/cama/seguimiento?corte=2026-10-20&estatus=BENIGNO', headers=headers).status_code == 400
|
||||
assert client.get('/cama/seguimiento?revision=' + '0' * 64, headers=headers).status_code == 400
|
||||
client.application.config['CAMA_COHORT_ACCESS'] = 'invalid'
|
||||
assert client.get('/cama/seguimiento', headers=headers).status_code == 403
|
||||
|
||||
|
||||
def test_disabled_provider_and_empty_window(client):
|
||||
|
||||
@@ -45,7 +45,7 @@ def cutoff_arg(args):
|
||||
|
||||
def patient_access():
|
||||
check = current_app.config.get('CAMA_COHORT_ACCESS')
|
||||
if callable(check) and not check(request):
|
||||
if check is not None and (not callable(check) or not check(request)):
|
||||
raise SelectionError('Acceso no autorizado', 403)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user