opensafely-core / airlock

Other
0 stars 0 forks source link

Workspace files are added to a new request instead of a returned request #424

Closed madwort closed 1 week ago

madwort commented 1 week ago

Just noticed something & I’m not sure if it’s a nit or a feature… am I holding something wrong or is this what it’s supposed to do?

steps to reproduce:

observed behaviour:

expected behaviour:

madwort commented 1 week ago

@rebkwok says:

Bug - looks like get_active_requests_for_workspace_by_user in local_db needs to be updated to look for PENDING, SUBMITTED and RETURNED requests

Although, we'll need to handle the case where there's a submitted and returned one, I think. A user can create a new request when they have one that's submitted. If the submitted one is then returned, they'll have two that are considered "active" and the bll get_current_request will raise an exception

rebkwok commented 1 week ago

Actually, I was wrong about having to handle multiple active requests. If you have a pending OR submitted one, you can't create a new one, so if we just add returned to that list of "active" requests, we should be fine.

rebkwok commented 1 week ago

Summarising slack discussion: