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

Raise 404 on celery progress view if the user is anonymous

(cherry picked from commit 2ecbe91b)
parent 129f684a
No related branches found
No related tags found
1 merge request!708Prepare release 2.0rc5
......@@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* The view for getting the progress of celery tasks didn't respect that there can be anonymous users.
`2.0rc4`_ - 2021-08-01
----------------------
......
......@@ -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