Commit Graph

12206 Commits

Author SHA1 Message Date
Tim Graham 36a17be9f3 Fixed #24426 -- Displayed admin actions panel when show_full_result_count=False. 2015-03-04 12:00:12 -05:00
Tim Graham fe42bfaaff Used format_html() in contrib.admin.utils for consistency. 2015-03-04 10:26:04 -05:00
Markus Holtermann a9e29fae10 Fixed #24435 -- Prevented m2m field removal and addition in migrations when changing blank
Thanks Mark Tranchant for the report an Tim Graham for the test and
review.
2015-03-04 14:26:49 +01:00
Preston Timmons 70123cf084 Fixed #24399 -- Made filesystem loaders use more specific exceptions. 2015-03-03 21:20:46 +01:00
Mathias André 85757d0e79 Removed outdated docstring for get_admin_url().
Since a4b8a4b632 the admin
URL returned by get_admin_url() is no longer relative to
the Django admin index page.
2015-03-03 07:46:12 -05:00
Preston Timmons 358850781f Fixed #24372 - Replaced TokenParser usage with traditional parsing. 2015-03-02 18:25:28 -05:00
Claude Paroz 80be597a7b Fixed #24360 -- Delayed internal LocaleMiddleware variable initialization
Failing in a middleware `__init__` is preventing proper debug view.
2015-03-02 20:06:24 +01:00
Andrei Kulakov 08572e8d12 Fixed #24294 -- Allowed staff_member_required decorator to handle args. 2015-03-02 13:15:34 -05:00
Tim Graham 4e8b167e4d Fixed MySQL build failure introduced by refs #24390.
Added table_name back to _create_index_sql() to prevent
duplicate index names on MySQL.
2015-03-02 13:07:34 -05:00
László Károlyi f37c11eea3 Fixed #24390 -- Made migration index names deterministic. 2015-03-02 09:25:19 -05:00
Corey Farwell 4fdc7015c0 Used dict comprehension in URLNode
4468c08d7 replaced a lot of the old `dict()` comprehensions
with the new style, but missed this one.
2015-03-02 08:50:27 -05:00
Preston Timmons 80d6b6b863 Fixed #24409 -- Combined the app_directories and filesystem loader implementation.
Besides the directories they look in, these two loaders are functionally
the same. This removes unnecessary code duplication between the two.
2015-03-02 07:53:58 -05:00
Claude Paroz 4b8979e477 Fixed #17401 -- Made SelectDateWidget.render reflect wrong value
Thanks Marcin Wrobel for the initial patch.
2015-03-01 21:37:52 +01:00
Claude Paroz 23c612199a Simplified emit_post_migrate from flush command
Follow-up of f4f24d30e0.
2015-02-28 16:10:32 +01:00
Claude Paroz 90ab6ee612 Revert "Fixed #24369 -- Prevented crash when `flush`ing before db migration"
This reverts commit 9f1dbe29c0.
The proposed solution does not pass the test suite.
2015-02-28 12:11:27 +01:00
Claude Paroz 9f1dbe29c0 Fixed #24369 -- Prevented crash when `flush`ing before db migration
Thanks Thomas Tanner for the report.
2015-02-28 10:12:32 +01:00
Claude Paroz 3cf1c02695 Fixed #24413 -- Prevented translation fallback for English
Thanks Tomasz Kontusz for the report, Baptiste Mispelon for
analysis and Tim Graham for the review.
2015-02-28 10:07:12 +01:00
Claude Paroz 5cf96b49e4 Fixed #24418 -- Prevented crash in refresh_from_db with null fk
Thanks Johannes Lerch for the report, Tim Graham for the test case,
and Simon Charette for the review.
2015-02-27 20:23:07 +01:00
Jon Dufresne 3b966c2b73 Fixed #24229 -- Changed IntegerField to clean floats representing integers 2015-02-27 12:23:21 +01:00
Rolf Jagerman fa9cb5dcdc Fixed #24406 -- Improved SelectFilter js to use click events
The SelectFilter widget used href to execute javascript. This was
problematic if one wishes to customize the widget, since the href
javascript is executed after events are handled. This change modifies
the javascript to use click events to handle button behavior.
2015-02-26 12:50:09 -05:00
Tim Graham 47b35b1844 Fixed #24411 -- Avoided dict key/method clash in admin delete views. 2015-02-25 07:15:56 -05:00
Michael Angeletti 65441bbdb0 Fixed #24391 -- Made BoundField.value() cache callable values. 2015-02-24 19:50:55 -05:00
Stanislas Guerra 4c2f546b55 Fixed #24395 -- Ensured inline ModelsForms have an updated related instance. 2015-02-24 11:49:00 -05:00
Aymeric Augustin b9c619abc1 Prevented makemigrations from writing in sys.path[0].
There's no reason to assume that sys.path[0] is an appropriate location
for generating code. Specifically that doesn't work with extend_sys_path
which puts the additional directories at the end of sys.path.

In order to create a new migrations module, instead of using an
arbitrary entry from sys.path, import as much as possible from the path
to the module, then create missing submodules from there.

Without this change, the tests introduced in the following commit fail,
which seems sufficient to prevent regressions for such a refactoring.
2015-02-23 19:55:10 +01:00
Tim Graham 1306cd1e8a Fixed #24377 -- Fixed model inline formsets with primary key's that have defaults. 2015-02-23 08:44:27 -05:00
Emin Mastizada dda2a3cf4c Added formats for the Azerbaijani locale. 2015-02-23 07:37:13 -05:00
Anssi Kääriäinen f95122e541 Fixed #24381 -- removed ForeignObjectRel opts and to_opts
These cached properies were causing problems with pickling, and in
addition they were confusingly defined: field.rel.model._meta was
not the same as field.rel.opts.

Instead users should use field.rel.related_model._meta inplace of
field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts.
2015-02-23 07:24:43 -05:00
Marten Kenbeek 78d43a5e10 Fixed #24366 -- Optimized traversal of large migration dependency graphs.
Switched from an adjancency list and uncached, iterative depth-first
search to a Node-based design with direct parent/child links and a
cached, recursive depth-first search. With this change, calculating
a migration plan for a large graph takes several seconds instead of
several hours.

Marked test `migrations.test_graph.GraphTests.test_dfs` as an expected
failure due to reaching the maximum recursion depth.
2015-02-23 12:38:53 +01:00
Michael Manfre 7fa7dd48c4 Fixed signature of BaseDatabaseOperations.date_interval_sql() and document the change. 2015-02-22 23:23:16 -05:00
Aymeric Augustin 556a74879f Fixed a few uses of Template that relied on a default engine.
Refs #24389.
2015-02-22 23:13:55 +01:00
Aymeric Augustin c688460df6 Removed rmtree_errorhandler.
The stated reason for its introduction in d18d37ce no longer applies
since Django's code repository was switched from Subversion to git.

Furthermore it never had any effect because shutil.rmtree ignores its
onerror argument when ignore_errors is True.

The reason for its use in template management commands is unclear.
2015-02-22 23:09:42 +01:00
Aymeric Augustin 88a5f17d25 Fixed #24389 -- Isolated the CSRF view from the TEMPLATES setting.
Thanks uranusjr for the report and analysis.
2015-02-22 15:46:35 +01:00
Michael Angeletti ea3168dc6c Fixed #24376 -- added verbose_name arg to UUIDField 2015-02-21 13:27:49 -05:00
Don Kirkby 99a1bbf985 Fixed typo in django/db/models/fields/files.py comment. 2015-02-20 20:11:13 -05:00
foresmac 1d1d5d1c31 Fixed #24341 -- Added specific error messages to RangeField subclasses 2015-02-20 16:49:15 -05:00
Simon Charette 19f7278c86 Removed reference to iteration count in the PBKDF2 hasher docstring. 2015-02-20 16:37:29 -05:00
Aymeric Augustin 51b606f75d Removed a non-obvious side-effect of assigning Context.template.
Explicit is better than implicit.
2015-02-20 22:27:48 +01:00
Frank Wiles e43f99d1a9 Fixed PBKDF2PasswordHasher comments to reflect reality. 2015-02-20 16:00:51 -05:00
Anssi Kääriäinen bad5f262bf Fixed #24328 -- cleaned up Options._get_fields() implementation 2015-02-20 13:00:12 -05:00
Loic Bistuer bed504d70b Fixed #24351, #24346 -- Changed the signature of allow_migrate().
The new signature enables better support for routing RunPython and
RunSQL operations, especially w.r.t. reusable and third-party apps.

This commit also takes advantage of the deprecation cycle for the old
signature to remove the backward incompatibility introduced in #22583;
RunPython and RunSQL won't call allow_migrate() when when the router
has the old signature.

Thanks Aymeric Augustin and Tim Graham for helping shape up the patch.

Refs 22583.
2015-02-20 21:34:09 +07:00
Marc Tamlyn c490e410af Fixed #24373 -- Added run_validators to ArrayField.
Thanks to DavidMuller for the report.
2015-02-20 11:51:46 +00:00
Marc Tamlyn 32d4db66b9 Update converters to take a consistent set of parameters.
As suggested by Anssi. This has the slightly strange side effect of
passing the expression to Expression.convert_value has the expression
passed back to it, but it allows more complex patterns of expressions.
2015-02-20 11:35:52 +00:00
Marc Tamlyn 4755f8fc25 Fixed #24343 -- Ensure db converters are used for foreign keys.
Joint effort between myself, Josh, Anssi and Shai.
2015-02-20 11:35:51 +00:00
Alex Vidal e467919c63 Fixed typo in django.core.servers.basehttp message. 2015-02-19 19:31:49 -05:00
Aymeric Augustin 1bfcc950ab Set context.template instead of context.engine while rendering.
This opens more possibilities, like accessing context.template.origin.

It also follows the chain of objects instead of following a shortcut.
2015-02-19 22:08:11 +01:00
Claude Paroz efb1f99f94 Fixed #20889 -- Prevented BadHeaderError when Python inserts newline
Workaround for http://bugs.python.org/issue20747.
In some corner cases, Python 2 inserts a newline in a header value
despite `maxlinelen` passed in Header constructor.
Thanks Tim Graham for the review.
2015-02-19 20:18:31 +01:00
Shai Berger ceadc94f09 Fixed #24307: Avoided redundant column nullability modifications on Oracle
Thanks Joris Benschop for the report, and Tim Graham for the tests.
2015-02-19 02:39:41 +02:00
Marten Kenbeek 15dc8d1c9d Fixed #24291 - Fixed migration ModelState generation with unused swappable models
Swapped out models don't have a _default_manager unless they have
explicitly defined managers. ModelState.from_model() now accounts for
this case and uses an empty list for managers if no explicit managers
are defined and a model is swapped out.
2015-02-18 19:05:10 +01:00
Adam Chainz e9282747a4 Removed unused foreign_key_re variables in MySQL/Oracle DB backends 2015-02-18 10:22:30 -05:00
Tim Graham 098fa12dd3 Refs #24324 -- Fixed crash in {% debug %} tag on Python 2.
If Django is installed in a path that contains non-ASCII characters,
the tag failed with UnicodeDecodeError.
2015-02-18 07:24:13 -05:00