Skip to content

Commit 7f85ea5

Browse files
committed
escaping CSRF from api request
1 parent ef63c9d commit 7f85ea5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pythonpro/core/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from django.conf import settings
44
from django.contrib.auth import login, update_session_auth_hash
55
from django.contrib.auth.decorators import login_required
6+
from django.views.decorators.csrf import csrf_exempt
67
from django.contrib.auth.forms import SetPasswordForm
78
from django.contrib.auth.views import PasswordChangeView, PasswordResetView
89
from django.http import HttpResponseRedirect, HttpResponse
@@ -249,6 +250,7 @@ def lead_landing_with_no_registration(request, *args, **kwargs):
249250
# return redirect('https://pythonpro.com.br/python-birds-obrigado/')
250251

251252

253+
@csrf_exempt
252254
@require_http_methods(["POST"])
253255
def api_register_and_subscribe_fellow(request):
254256
if not core_facade.is_api_key_valid(request.GET.get('key')):

0 commit comments

Comments
 (0)