-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix downloading UI #456
Fix downloading UI #456
Conversation
rdwatch/scoring/views/model_run.py
Outdated
@@ -507,11 +507,9 @@ def list_model_runs( | |||
@router.get('/{id}/', response={200: ModelRunDetailSchema}) | |||
def get_model_run(request: HttpRequest, id: UUID4): | |||
try: | |||
EvaluationRun.objects.get(pk=id) | |||
data = get_queryset() | |||
data = get_object_or_404(get_queryset(), id=id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think get_object_or_404
raises EvaluationRun.DoesNotExist
here, so wouldn't this fail prematurely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding that, you're correct. This won't properly swap to the proposal query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to give a more descriptive error with missing EvaluationRun/AnnotationProposalSet.
resolves #431