Commit Graph

5685 Commits

Author SHA1 Message Date
Andrey Maslov 8de2a44064 [1.7.x] Fixed #24008 -- Fixed ValidationError crash with list of dicts.
Backport of 7a878ca5cb from master
2014-12-31 14:46:17 -05:00
Tim Graham 4abfa73c18 [1.7.x] Renamed tests for util -> utils moves; refs #17627.
Backport of 8a9b0c15a6 from master
2014-12-31 11:33:27 -05:00
Tim Graham c0bed63889 [1.7.x] Fixed a queries test on Python 2 broken after importing six.moves.range().
Backport of 837fc2d8cd from master
2014-12-31 09:51:10 -05:00
Piotr Pawlaczek e11ff3975f [1.7.x] Fixed #23758 -- Allowed more than 5 levels of subqueries
Refactored bump_prefix() to avoid infinite loop and allow more than
than 5 subquires by extending the alphabet to use multi-letters.

Backport of 41fc1c0b5e from master
2014-12-31 09:42:07 -05:00
Markus Holtermann d49b5851b4 [1.7.x] Added test for an intermediate swappable model change in migration state.
refs #22563

Backport of fca866763a from master
2014-12-30 10:03:41 -05:00
Tim Graham a9da5dd5b6 [1.7.x] Fixed #23581 -- Prevented extraneous DROP DEFAULT statements.
Thanks john_scott for the report and Markus Holtermann for review.

Backport of ab4f709da4 from master
2014-12-30 08:31:18 -05:00
Tim Graham 79645529e7 Revert "[1.7.x] Fixed #23938 -- Added migration support for m2m to concrete fields and vice versa"
This reverts commit 1702bc52cc.

This doesn't work on stable/1.7.x because #23844 wasn't backported and we're
not willing to do so because it's a large change.
2014-12-29 15:37:15 -05:00
Markus Holtermann 1702bc52cc [1.7.x] Fixed #23938 -- Added migration support for m2m to concrete fields and vice versa
Thanks to Michael D. Hoyle for the report and Tim Graham for the review.

Backport of 623ccdd598 from master
2014-12-29 13:42:29 -05:00
Aymeric Augustin 3483682749 [1.7.x] Fixed #23831 -- Supported strings escaped by third-party libs in Django.
Refs #7261 -- Made strings escaped by Django usable in third-party libs.

The changes in mark_safe and mark_for_escaping are straightforward. The
more tricky part is to handle correctly objects that implement __html__.

Historically escape() has escaped SafeData. Even if that doesn't seem a
good behavior, changing it would create security concerns. Therefore
support for __html__() was only added to conditional_escape() where this
concern doesn't exist.

Then using conditional_escape() instead of escape() in the Django
template engine makes it understand data escaped by other libraries.

Template filter |escape accounts for __html__() when it's available.
|force_escape forces the use of Django's HTML escaping implementation.

Here's why the change in render_value_in_context() is safe. Before Django
1.7 conditional_escape() was implemented as follows:

    if isinstance(text, SafeData):
        return text
    else:
        return escape(text)

render_value_in_context() never called escape() on SafeData. Therefore
replacing escape() with conditional_escape() doesn't change the
autoescaping logic as it was originally intended.

This change should be backported to Django 1.7 because it corrects a
feature added in Django 1.7.

Thanks mitsuhiko for the report.

Backport of 6d52f6f from master.
2014-12-27 18:26:20 +01:00
Aymeric Augustin b429a9796a [1.7.x] Fixed an inconsistency introduced in 547b1810.
mark_safe and mark_for_escaping should have been kept similar.

On Python 2 this change has no effect. On Python 3 it fixes the use case
shown in the regression test for mark_for_escaping, which used to raise
a TypeError. The regression test for mark_safe is just for completeness.

Backport of 5c5eb5fe from master.
2014-12-27 18:17:18 +01:00
Claude Paroz 322560489b [1.7.x] Fixed #24051 -- Made schema infrastructure honor tablespaces
Partial backport of 30cbd5d36. Thanks Douglas J. Reynolds for the
report and initial patch.
2014-12-27 15:12:17 +01:00
Tim Graham 51ea30a43b [1.7.x] Fixed #24037 -- Prevented data loss possibility when changing Meta.managed.
The migrations autodetector now issues AlterModelOptions operations for
Meta.managed changes instead of DeleteModel + CreateModel.

Thanks iambibhas for the report and Simon and Markus for review.

Backport of 061caa5b38 from master
2014-12-23 14:26:56 -05:00
Oscar Ramirez 1ad5deedd4 [1.7.x] Fixed #23998 -- Added datetime.time support to migrations questioner.
Backport of 54085b0f9b from master
2014-12-22 07:26:57 -05:00
Claude Paroz ea18652238 [1.7.x] Made model_regress unpickling test CWD-independent
Refs #24007. Thanks Tim Graham for his help with the patch.

Backport of 1d9fc5caa9 and
995be4a137 from master
2014-12-19 14:26:46 -05:00
Claude Paroz f46a16614d [1.7.x] Fixed #24015 -- Factorized create_index_sql expression
Backport of 6072f17d0 from master, with one test reinforced.
Thanks Tim Graham for the review.
2014-12-18 21:14:29 +01:00
Claude Paroz 47912d9f2b [1.7.x] Fixed #24007 -- Ensure apps registry's ready before unpickling models
This prevents AppRegistryNotReady errors when unpickling Django
models from an external script.
Backport of 108b8bf85 from master.
2014-12-17 18:41:12 +01:00
Mosson, Andrew 6d8c14621e [1.7x.] Fixed #23497 -- Made admin system checks run for custom AdminSites.
Backport of b7219c7ba5 from master
2014-12-17 09:16:05 -05:00
Tim Graham c085bea6c3 [1.7.x] Fixed #23975 -- Restored pre_migrate signal if all apps have migrations.
Thanks kmmbvnr for the report.

Backport of d2ff8a7241 from master
2014-12-16 18:39:19 -05:00
Andriy Sokolovskiy 10482faf19 [1.7.x] Fixed #23983 -- Fixed a crash in migrations when adding order_with_respect_to to non-empty table.
Backport of 3dbbb8a89c from master
2014-12-16 10:56:35 -05:00
Tim Graham 66c0529b3e [1.7.x] Fixed refs #23987 test on Oracle.
Backport of ac5f2a4ef7 from master
2014-12-15 18:20:41 -05:00
Andriy Sokolovskiy fdf4dc6cea [1.7.x] Fixed #23405 -- Fixed makemigrations prompt when adding Text/CharField.
A default is no longer required.

Backport of d8f3b86a76 from master
2014-12-15 14:58:01 -05:00
Andriy Sokolovskiy 1690b92b0d [1.7.x] Fixed #23987 -- Made SQLite SchemaEditor always use effective_default().
Backport of 089047331d from master
2014-12-15 13:42:08 -05:00
Carl Meyer 0a8b911582 [1.7.x] Fixed #23455 -- Accept either bytes or text for related_name, convert to text.
Backport of c72eb80d11 from master.
2014-12-12 13:13:57 -07:00
Carl Meyer f8b4cf4022 [1.7.x] Revert "Fixed #23455 -- Forced related_name to be a unicode string during deconstruction."
This reverts commit 45bd7b3bd9.

This is a backport of 8aaf51f94c from master.
2014-12-12 13:09:04 -07:00
Tim Graham c64286c62b [1.7.x] Fixed #23857 -- Fixed admin crash with "save as new" and deleting inline.
Thanks amarandon for the report.

Backport of c7a19f4203 from master
2014-12-12 11:49:44 -05:00
Grzegorz Slusarek 4b96e862b4 [1.7.x] Fixed #23674 -- Fixed a crash when a MultiValueField has invalid data.
Backport of 0dea81cd6d from master
2014-12-12 08:50:38 -05:00
Markus Holtermann f446acf8bb [1.7.x] Fixed #23956 -- Fixed migration creation for multiple table inheritance
Backport of 44927ba817 from master
2014-12-11 13:28:57 -05:00
Claude Paroz 6ba960266a [1.7.x] Fixed #23954 -- Added special text/varchar PostgreSQL indexes in migrations
Thanks adityagupta104 for the report and Tim Graham for the review.
Backport of 8d7a48027e from master.
2014-12-04 21:39:32 +01:00
Tim Graham d57124433f [1.7.x] Fixed #23920 -- Fixed MySQL crash when adding blank=True to TextField.
Thanks wkornewald for the report and Markus Holtermann for review.

Backport of 765fa36d57 from master
2014-12-04 10:59:05 -05:00
Tim Graham 5219a02fda [1.7.x] Added a test to verify headers set by default middleware; refs #23939.
Backport of 50c1d8f24b from master
2014-12-03 14:17:05 -05:00
Gavin Wahl e9975ed3cd [1.7.x] Fixed #23950 -- Prevented calling deconstruct on classes in MigrationWriter.
Backport of dee4d23f7e from master
2014-12-03 08:32:59 -05:00
Kamil Braun ccc30ffe57 [1.7.x] Fixed #23934 -- Fixed regression in admin views obj parameter.
Backport of 0623f4dea4 from master
2014-12-02 08:43:59 -05:00
Claude Paroz 3a42d9730c [1.7.x] Fixed #23909 -- Prevented crash when collecting SQL for RunSQL
Thanks James Rivett-Carnac for the report and Markus Holtermann
for the review.
Backport of e11c6fd21 from master.
2014-12-02 09:02:54 +01:00
Tim Graham bc5bb3e1a0 [1.7.x] Fixed selenium test failure of JavascriptI18nTests.
The failure was introduced in dd1ea70779.
The tests wouldn't start due to a "Dependency on unknown app" error.

Backport of b8cc5f3cd4 from master
2014-12-01 17:04:44 -05:00
Tim Graham 943b1047de [1.7.x] Fixed flake8 warnings.
Backport of 392e11945f from master
2014-12-01 16:01:18 -05:00
Markus Holtermann ba3e976186 [1.7.x] Fixed #23880 -- Added missing index_together handling for SQLite
Backport of d2202ec2d4 from master
2014-12-01 16:00:36 -05:00
Carl Meyer 6f65bd1cf0 [1.7.x] Fixed #23872 -- Removed sensitivity of migrations tests to CWD.
Backport of 47b7f601ee from master.
2014-11-26 17:36:04 -07:00
Luke Plant 8e3c3be32d [1.7.x] Fixed bug in circular dependency algo for migration dependencies.
Previous algo only worked if the first item was a part of the loop,
and you would get an infinite loop otherwise (see test).

To fix this, it was much easier to do a pre-pass.

A bonus is that you now get an error message that actually helps you debug
the dependency problem.

Backport of ff3d746e8d from master, with
additional tests from c5def493d0
2014-11-26 08:15:33 +00:00
Simon Charette 2a20bccda9 [1.7.x] Fixed #23754 -- Always allowed reference to the primary key in the admin
This change allows dynamically created inlines "Add related" button to work
correcly as long as their associated foreign key is pointing to the primary
key of the related model.

Thanks to amorce for the report, Julien Phalip for the initial patch,
and Collin Anderson for the review.

Backport of f9c4e14aec from master
2014-11-25 13:32:24 -05:00
Redouane Zait f671905fdb [1.7.x] Fixed #23898 -- Added missing context to admin's deleted_selected view.
Backport of 8e7b384d89 from master
2014-11-25 11:27:30 -05:00
Sergey Fedoseev 78fe7ec14f [1.7.x] Fixed #23888 -- Fixed crash in File.__repr__() when name contains unicode.
Backport of 1e9ac504e4 from master
2014-11-24 15:55:43 -05:00
Alasdair Nicol f91c6ecc22 [1.7.x] Fixed #23865 -- documented how to assign errors to a field in Model.clean()
Also added a unit test wit the simpler syntax which we have documented,
where the dictionary values are strings.

Backport of 5b26a014a8 from master
2014-11-21 13:02:40 -05:00
Andrzej Pragacz feded19104 [1.7.x] Fixed #23794 -- Fixed migrations crash when removing a field that's part of index/unique_together.
Backport of 72729f844e from master
2014-11-21 10:57:38 -05:00
Markus Holtermann 145467a636 [1.7.x] Fixed duplicate index error on Oracle; refs #23859.
Refers to regression introduced in 7b4a994599

Backport of 4c709cc0ef from master
2014-11-20 14:44:05 -05:00
Anssi Kääriäinen 01f2cf2aec [1.7.x] Fixed #23605 -- Fixed nested subquery regression
Added relabeled_clone() method to sql.Query to fix the problem. It
manifested itself in rare cases where at least double nested subquery's
filter condition might target non-existing alias.

Thanks to Trac alias ris for reporting the problem.

Backport of 5c481db295 from master
2014-11-20 13:53:28 -05:00
Markus Holtermann 1b8c067a4f [1.7.x] Cleaned up and reformatted autodetector tests
Backport of 2331650835 from master.
2014-11-19 18:25:00 -05:00
Markus Holtermann 2f8cd09a06 [1.7.x] Formatted model states in autodetector tests
Backport of f17acd5930 from master.
2014-11-19 18:25:00 -05:00
Carl Meyer 03e8c18288 [1.7.x] Fixed #23410 -- Avoided unnecessary rollbacks in related apps when migrating backwards.
Backport of ab2819aa7b from master.
2014-11-19 16:15:05 -07:00
Stratos Moros 50434aebe2 [1.7.x] Fixed #22248 -- Made RenameModel reversible
Backport of cf7a2a000e from master
2014-11-19 09:51:07 -05:00
Tillmann Karras dfcac7d7f5 [1.7.x] Fixed #23799 -- Made makemigrations respect --no-optimize.
Thanks to yamila-moreno for the idea of a skip message.

Backport of d188101319 from master
2014-11-18 09:20:04 +01:00