Commit graph

7 commits

Author SHA1 Message Date
Karl Hobley
1f84db8a24 Return a 403 response for unauthenticated ajax requests
At the moment, Wagtail redirects all requests (including AJAX) to the
login view. This is not usually the expected thing to do for AJAX and can
lead to the login page being nested in a component somewhere (which
looks horrible).

This changes the behaviour so requests that come from AJAX are given a
plain 403 error. This allows the code that performed the request to
handle the issue properly.
2017-04-20 16:57:12 +01:00
Bertrand Bordage
15daeb80d2 Typos for #3310. 2017-04-19 14:48:20 +02:00
Daniel Chimeno
72a935a8f0 Adds user-prefered admin language (#3310).
added prefered language field and migration

added form and view to select prefered language

Added some tests

modified tests

fix styleguide errors

activate middleware only for authenticated users

fixed typos

fixed test undoing language preferences

fixed lint issues

fixed tests

fixed message

change behaviour and more test added

added utf8 coding

[skip ci] initial documentation for preferred language

added contributor

refactor get_available_admin_languages

refactor get_available_admin_languages

make language name language aware

translate notifications to recipient language

make language name language aware

fixed lint
2017-04-19 14:48:06 +02:00
Matt Westcott
cca1ab4089 Eliminate Django 2.0 deprecation warnings for on_delete, is_anonymous, is_authenticated (#2829)
* Add on_delete kwarg to foreign keys that are missing it

* Add compat functions for user.is_anonymous and user.is_authenticated
2016-07-08 16:33:16 +03:00
Tim Heap
a0af3d6685 Ensure absolute_import, unicode_literals imported in all files
Drone will now check that

    from __future__ absolute_import, unicode_literals

is part of every Python source file, to ensure a consistent experience
across all versions of Python.

See #2392 for an instance where missing `unicode_literals` was causing
problems.

Add missing absolute_import, unicode_literals to all files

Explicitly ensure strings are of the correct types

Now that unicode_literals is in every file, some things that used to
be py2 `str`s were now `unicode` instead. This caused issues with
generated class / function names, which must be `str` in all versions of
Python. This means bytes in py2, and unicode in py3. A test also checked
for the incorrect type of SafeString. HTML content should always be
unicode, so this has been fixed.
2016-04-03 13:11:48 +03:00
Tim Heap
861bd2de14 Sort imports using isort
```
$ pip install isort -e .[testing,docs]
$ isort --recursive wagtail/
$ git add wagtail
$ git commit
```
2016-03-11 10:48:00 +00:00
Tim Heap
dc0dcc9d9b Show a message to users who do not have permission to access admin
Fixes #1486
2016-03-01 15:46:38 +00:00