The CSRF view already gives a relatively friendly (although not
translated) explanation if Referer headers are turned off. I suggest
adding one for a non-existing cookie too, patch attached against latest
trunk.
I'm attaching a little test project in a tarball.
I think this is an old problem, the patch here was originally against 1.2
(credit goes to Henrik Levkowetz).
--
Ticket URL: <https://code.djangoproject.com/ticket/21322>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* type: Bug => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
I created #21324 to track the non-translated issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/21322#comment:1>
* needs_better_patch: 0 => 1
Comment:
Now that #21324 has been fixed, the patch needs to accommodate for content
translation.
--
Ticket URL: <https://code.djangoproject.com/ticket/21322#comment:2>
* status: new => assigned
* needs_better_patch: 1 => 0
* owner: nobody => bouke
Comment:
I've rebased the patch and added tests that check for the various error
messages: https://github.com/django/django/pull/1859
--
Ticket URL: <https://code.djangoproject.com/ticket/21322#comment:3>
* cc: bouke (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/21322#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"9b95fa7777c4b484f8053b87f48d65c853945f19"]:
{{{
#!CommitTicketReference repository=""
revision="9b95fa7777c4b484f8053b87f48d65c853945f19"
Fixed #21322 -- Error message when CSRF cookie is missing
Thanks to Henrik Levkowetz and olau for their reports and initial patches.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21322#comment:5>