Ticket #15198: safe-patch-cookie.diff

File safe-patch-cookie.diff, 597 bytes (added by sven.assmann@…, 3 years ago)

this should avoid the cookie issue when the request is avaliable on both request types get and post

  • django/contrib/auth/forms.py

    diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
    index 780b0c0..84d8bbb 100644
    a b class AuthenticationForm(forms.Form): 
    166166        return self.cleaned_data
    167167
    168168    def check_for_test_cookie(self):
    169         if self.request and not self.request.session.test_cookie_worked():
     169        if self.request and self.request.method != "POST" and not self.request.session.test_cookie_worked():
    170170            raise forms.ValidationError(self.error_messages['no_cookies'])
    171171
    172172    def get_user_id(self):
Back to Top