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

Queueing a report to be sent via email doesn't work #702

Open
jarcoal opened this issue Mar 12, 2025 · 0 comments · May be fixed by #703
Open

Queueing a report to be sent via email doesn't work #702

jarcoal opened this issue Mar 12, 2025 · 0 comments · May be fixed by #703

Comments

@jarcoal
Copy link

jarcoal commented Mar 12, 2025

Currently when you try and have a report emailed, the request from the send modal to the server fails:

Image

The expectation that isn't being met is that the front-end isn't passing an "X-Requested-With" header, which is causing this logic to fail:

def post(self, request, query_id, *args, **kwargs):
if request.headers.get("x-requested-with") == "XMLHttpRequest":
email = request.POST.get("email", None)
if email:
execute_query.delay(query_id, email)
return JsonResponse(
{"message": "message was sent successfully"}
)
return JsonResponse({}, status=403)

I believe this was caused by this commit, which switched from using jQuery, which emits an X-Requested-With header, to fetch, which does not:

c4278c2#diff-c2106f38c65afec174958944fc7f073b461b2ae16929467de22e49e76e6055e4L56-R63

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 a pull request may close this issue.

1 participant