Skip to content
Snippets Groups Projects
Verified Commit 2ecbe91b authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Raise 404 on celery progress view if the user is anonymous

parent 9a55dd98
No related branches found
No related tags found
1 merge request!703Resolve "TypeError at /celery_progress/.../ 'AnonymousUser' object is not iterable"
Pipeline #25567 passed with warnings
......@@ -14,6 +14,10 @@ Added
* Allow apps to dynamically generate OAuth scopes
Fixed
~~~~~
* The view for getting the progress of celery tasks didn't respect that there can be anonymous users.
Removed
~~~~~~~
......
......@@ -1151,6 +1151,8 @@ class CeleryProgressView(View):
"""Wrap celery-progress view to check permissions before."""
def get(self, request: HttpRequest, task_id: str, *args, **kwargs) -> HttpResponse:
if request.user.is_anonymous:
raise Http404()
if not TaskUserAssignment.objects.filter(
task_result__task_id=task_id, user=request.user
).exists():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment