Skip to content

fix: handle instances of deleted labs in running/finished labs views - #323

Open
italovalcy wants to merge 2 commits into
mainfrom
fix/finished-labs-deleted-lab-keyerror
Open

italovalcy wants to merge 2 commits into
mainfrom
fix/finished-labs-deleted-lab-keyerror

Conversation

@italovalcy

Copy link
Copy Markdown
Contributor

Fixes #322

allowed_groups_by_lab is built only from existing labs, so lab instances whose lab was deleted raised KeyError in the permission check (/finished_labs, and the same pattern in the running labs view) for non-admin group owners/assistants.

Use allowed_groups_by_lab.get(li.lab_id, {}) so such instances are treated as having no allowed groups. Admins and the instance's own user still see them (with the existing "Unknow Lab" title).

🤖 Generated with Claude Code

…322)

allowed_groups_by_lab only contains existing labs, so instances whose
lab was deleted raised KeyError for group owners/assistants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyError on /finished_labs when a finished lab instance references a deleted lab

1 participant