Skip to content
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

[BUG] Pushing 'w' to go to the next node to review throws an excessive error when the node has been deleted #2270

Open
acardona opened this issue Oct 2, 2024 · 0 comments

Comments

@acardona
Copy link
Contributor

acardona commented Oct 2, 2024

Part of the problem is that deleting and adding nodes isn't notified to the Review widget, but solving that would take quite some effort.

Instead, just show an non-invasive notification that the node doesn't exist and move on. The error is massive and sends the message that something is broken, when it isn't:

Unsuccessful request: {"error": "No Treenode matches the given query.", "detail": "Traceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/applications/catmaid/control/node.py\", line 2817, in update_location_reviewer\n r = Review.objects.get(treenode_id=node_id, reviewer=request.user)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/db/models/manager.py\", line 85, in manager_method\n return getattr(self.get_queryset(), name)(*args, **kwargs)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/db/models/query.py\", line 435, in get\n raise self.model.DoesNotExist(\ncatmaid.models.Review.DoesNotExist: Review matching query does not exist.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/shortcuts.py\", line 76, in get_object_or_404\n return queryset.get(*args, **kwargs)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/db/models/query.py\", line 435, in get\n raise self.model.DoesNotExist(\ncatmaid.models.Treenode.DoesNotExist: Treenode matching query does not exist.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/core/handlers/base.py\", line 181, in _get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n File \"/usr/lib/python3.8/contextlib.py\", line 75, in inner\n return func(*args, **kwds)\n File \"/opt/catmaid/fibsem/django/applications/catmaid/history.py\", line 69, in wrapped_f\n result = f(*args, **kwargs)\n File \"/opt/catmaid/fibsem/django/applications/catmaid/control/authentication.py\", line 235, in inner_decorator\n return f(request, *args, **kwargs)\n File \"/opt/catmaid/fibsem/django/applications/catmaid/control/node.py\", line 2819, in update_location_reviewer\n node = get_object_or_404(Treenode, pk=node_id)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/shortcuts.py\", line 78, in get_object_or_404\n raise Http404('No %s matches the given query.' % queryset.model._meta.object_name)\ndjango.http.response.Http404: No Treenode matches the given query.\n", "type": "Http404", "meta": null}```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant