opensafely-core / airlock

Other
0 stars 0 forks source link

Add a small guard rail #445

Closed madwort closed 5 days ago

madwort commented 5 days ago

If you call create_request_at_status with status WITHDRAWN and withdrawn_after as an invalid value (in my case SUBMITTED), you currently don't get an error, you get a valid request in the withdrawn_after status (i.e. SUBMITTED), which can lead to misleading failures in the tests you're working on.

We could also put a bunch of bll.set_status() calls in the relevant places to trigger the actual Exceptions for this stuff, but this is shorter (& I think it only applies to WITHDRAWN).