Skip to content

Fix AttributeError crash in _editAnnotator when annotator is not found - #81

Open
ArneshBanerjee wants to merge 1 commit into
RedHenLab:masterfrom
ArneshBanerjee:fix/edit-annotator-null-check
Open

Fix AttributeError crash in _editAnnotator when annotator is not found#81
ArneshBanerjee wants to merge 1 commit into
RedHenLab:masterfrom
ArneshBanerjee:fix/edit-annotator-null-check

Conversation

@ArneshBanerjee

Copy link
Copy Markdown

Fixes #70

_editAnnotator was calling .start on the result of a .first() query without checking if it returned None. If the annotatorId didn't match any AnnotatorAssociation for the given experiment, it crashed with AttributeError: 'NoneType' object has no attribute 'start'. Added a null check that returns a 404 JSON response instead.

The query could return None if the annotatorId doesn't match any
AnnotatorAssociation for the given experiment, which caused an
AttributeError crash on annotatorDetails.start. Added a null check
that returns a 404 JSON response instead.

Fixes RedHenLab#70
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.

Can't add annotator to project

1 participant