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

fix: fix request.is_ajax() deprecation warning #33055

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

UsamaSadiq
Copy link
Member

@UsamaSadiq UsamaSadiq marked this pull request as ready for review August 18, 2023 11:04
@@ -288,7 +288,7 @@ def forum_form_discussion(request, course_key):
"""
course = get_course_with_access(request.user, 'load', course_key, check_if_enrolled=True)
request.user.is_community_ta = utils.is_user_community_ta(request.user, course.id)
if request.is_ajax():
if request.headers.get('x-requested-with') == 'XMLHttpRequest':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5dcb8812157' and requested host was 'awais786.sandbox.edx.org'; CORS_ORIGIN_ALLOW_ALL=False
2023-08-18 14:03:16,660 INFO 187478 [edx.discussions] [user 20] [ip 44.230.155.124] views.py:356 - XMLHttpRequest
2023-08-18 14:03:16,660 INFO 187478 [edx.discussions] [user 20] [ip 44.230.155.124] views.py:357 - -------------------------------
2023-08-18 14:03:16,660 INFO 187478 [edx.discussions] [user 20] [ip 44.230.155.124] views.py:359 - vvvvvvvvvvvvvvv

verified logs appearing after condition got true.

@UsamaSadiq UsamaSadiq merged commit 3949c73 into master Aug 21, 2023
42 checks passed
@UsamaSadiq UsamaSadiq deleted the fix-request-is-ajax-deprecation branch August 21, 2023 10:59
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

mehedikhan72 pushed a commit to mehedikhan72/edx-platform that referenced this pull request Aug 24, 2023
* fix: fix request.is_ajax() deprecation warning
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 this pull request may close these issues.

3 participants