Commit Graph

11580 Commits

Author SHA1 Message Date
Anssi Kääriäinen 9cd5201abd Fixed #22994 -- regression with generic FK + admin list_view
The reason for the regression was that the GenericForeignKey field isn't
something meta.get_field_by_name() should return. The reason is that a
couple of places in Django expects get_field_by_name() to work this way.
It could make sense to return GFKs from get_field_by_name(), but that
should likely be done as part of meta refactoring or virtual fields
refactoring patches.

Thanks to glicerinu@gmail.com for the report and to Tim for working on
the issue.
2014-07-14 10:50:41 -04:00
Tim Graham 38e001ab6c Fixed #22789 -- Deprecated django.contrib.webdesign.
Moved the {% lorem %} tag to built-in tags.
2014-07-14 08:45:19 -04:00
Alex Gaynor 037f81fedc Added a newline to appease flake8 2014-07-13 08:35:25 -07:00
Claude Paroz 22b2fb0ba1 Fixed #22939 -- Delayed admin_static backend detection
Thanks generalov for the report.
2014-07-12 18:49:43 +02:00
Aymeric Augustin a764a9ccff Checked more precisely whether the app registry is ready.
Accounted for the three stages of population: app configs, models,
ready() methods of app configs.
2014-07-12 18:49:37 +02:00
Tim Graham b48c2c5925 Removed extra newline. 2014-07-12 10:16:53 -04:00
Alex Gaynor 6732566967 Bump the default iterations for PBKDF2.
The rate at which we've increased this has not been keeping up with hardware (and software) improvements, and we're now considerably behind where we should be. The delta between our performance and an optimized implementation's performance prevents us from improving that further, but hopefully once Python 2.7.8 and 3.4+ get into more hands we can more aggressively increase this number.
2014-07-11 22:43:26 -07:00
Andrew Godwin ebb13bbd88 Fixed #22983: Alert when squashing RunPython operations with referred functions. 2014-07-11 19:00:39 -07:00
Tim Graham d5e1a2d5eb Added contrib.auth migration for refs #13147. 2014-07-10 13:06:42 -04:00
Yin Jifeng 849538d03d Fixed #13147 -- Moved User validation logic from form to model. 2014-07-10 09:36:43 -04:00
Andrew Godwin b02abd688a Fixed #22922: Better error message for InvalidBasesError. 2014-07-09 23:57:35 -07:00
Andrew Godwin 008bff92b7 Fixed #22970: Incorrect dependencies for existing migrated apps 2014-07-09 23:53:43 -07:00
Anubhav Joshi 011abb7d96 Fixed #19671 -- Added warnings that null and validators are ignored for ManyToManyField.
Thanks Loic Bistuer and Tim Graham for help and review.
2014-07-09 16:01:09 -04:00
Tim Graham 5e2c4a4bd1 Fixed #13794 -- Fixed to_field usage in BaseInlineFormSet.
Thanks sebastien at clarisys.fr for the report and gautier
for the patch.
2014-07-09 07:59:20 -04:00
Claude Paroz e167e96cfe Fixed #22223 -- Prevented over-escaping URLs in reverse()
And follow more closely the class of characters defined in the
RFC 3986.
Thanks Erik van Zijst for the report and the initial patch, and
Tim Graham for the review.
2014-07-09 09:54:34 +02:00
Anubhav Joshi 75ff7b8fb8 Fixed #21832 -- Updated prompt, tests, and docs to show that USERNAME_FIELD supports FK after 9bc2d76.
Also added get_input_data() hook in createsuperuser.

Thanks Chris Jerdonek and Tim Graham for review.
2014-07-08 08:21:41 -04:00
Tim Graham fddd95254e Fixed flake8 errors. 2014-07-07 19:12:39 -04:00
Claude Paroz 6d302f6396 Fixed pyinotify performance regression in 15f82c7011
Refs #9722. Thanks Tim Graham for the review.
2014-07-06 21:41:02 +02:00
Claude Paroz b144bfb5ce Fixed #21079 -- Further normalized table names in inspectdb
Thanks Michael Manfre for the report and Tim Graham for the review.
2014-07-06 21:19:27 +02:00
Loic Bistuer 2572c07cc6 Fixed #22906 -- Added a more helpful repr to migrations' ModelState.
Thanks Collin Anderson for the report and original patch.
2014-07-06 14:56:18 +07:00
Daniel Hahler 67f9f385aa Fixed various minor doc typos / references. 2014-07-05 20:26:26 -04:00
Tim Graham ab431fbd4f Fixed flake8 indentation. 2014-07-05 20:24:00 -04:00
Daniel Hahler fff7b507ef Added a space before explanation of "Invalid HTTP_HOST header: ..." 2014-07-05 20:18:52 -04:00
Andrew Godwin f751109cb2 Merge pull request #2881 from charettes/ticket-22943-compiled-regex-deconstruction
Fixed #22943 -- Correctly serialize compiled regexes.
2014-07-05 16:37:10 -07:00
Andrew Godwin 80a12f21e3 Fixed #22960: Bad handling of relations as PKs in autodetector 2014-07-05 16:33:03 -07:00
Claude Paroz dd9a23d5cf Fixed #22950 -- Eased markup customization for choice field rendering
Thanks Patrick Robertson for the report.
2014-07-05 13:36:49 +02:00
Claude Paroz 9209049211 Ensured bound field renders as unicode safe data
Refs #22950.
2014-07-05 11:42:27 +02:00
Tim Graham 1f8bb95cc2 Corrected domain max length for EmailValidator; refs #20631.
Thanks MarkusH for the report.
2014-07-04 20:50:28 -04:00
Tim Graham 7fd55c3481 Fixed #20631 -- Increased the default EmailField max_length to 254.
Thanks pmartin for the report.
2014-07-04 14:15:00 -04:00
Simon Charette 35c2c37041 Fixed #22943 -- Correctly serialize compiled regexes.
Thanks to antialiasis at gmail dot com for the patch.
2014-07-04 13:34:20 -04:00
Loic Bistuer 1966054feb Fixed #22915 -- Document backward incompatible changes in the ValidationError constructor.
This patch also fixes update_error_dict to better handle the use case described
in this ticket, previously the type of the provided container could be lost in
some conditions.

Thanks Russell Keith-Magee for the report and Tim Graham for review.
2014-07-04 17:05:31 +07:00
LarryBrid 1bb1d3168b Updated urlize regex following a93ee5112d
Prevent urlize from turning some.organization, an.intern etc.
into urls. Refs #22941.
2014-07-04 09:00:16 +02:00
Anubhav Joshi 9bc2d766a0 Fixed #21755 -- Added ForeignKey support to REQUIRED_FIELDS.
This allows specifying ForeignKeys in REQUIRED_FIELDS when using a
custom User model.

Thanks cjerdonek and bmispelon for suggestion and timgraham for review.
2014-07-03 07:42:52 -04:00
LarryBrid a93ee5112d Fixed #22941 - Added support for domain-only links with chars after the TLD to urlize.
It now works with something like google.com/foo/bar
2014-07-02 20:36:53 -04:00
Anubhav Joshi 10e83d48a3 Fixed #22935 -- Changed ForeignKey.default_error_messages['invalid'] to refer to correct field.
Thanks Tim Graham for suggestion and review.
2014-07-02 13:01:36 -04:00
Colin Wood 27ee608b55 Fixed #22940 -- Added missing string iterpolation parameters in migrations.writer error.
Forwardport of f5740af868 from stable/1.7.x
2014-07-02 12:45:02 -04:00
Tim Graham 7c3d6149a7 Removed ADMIN_FOR from global_settings.py.
The functionality it was used for was removed in Django 1.7.
2014-07-02 10:19:15 -04:00
Tim Graham 20ec9daf7c Fixed #22933 -- Deprecated django.template.resolve_variable(). 2014-07-01 17:29:41 -04:00
Anssi Kääriäinen 0b6f05ede6 Fixed #19501 -- added Model.from_db() method
The Model.from_db() is intended to be used in cases where customization
of model loading is needed. Reasons can be performance, or adding custom
behavior to the model (for example "dirty field tracking" to issue
automatic update_fields when saving models).

A big thank you to Tim Graham for the review!
2014-07-01 16:31:01 +03:00
Tim Graham c26579eaa7 Removed django/contrib/auth/create_superuser.py
It's a shim that calls the actual createsuperuser management command and
it's been marked as deprecated since Django 1.0.
2014-07-01 08:51:06 -04:00
Curtis 71461b14ab Fixed #22691 -- Added aliasing to cached_property. 2014-07-01 06:32:53 -04:00
Anubhav Joshi 34ba86706f Fixed #14334 -- Query relation lookups now check object types.
Thanks rpbarlow for the suggestion; and loic, akaariai, and jorgecarleitao
for reviews.
2014-07-01 06:12:58 -04:00
Julia Matsieva 29c1151a55 Fixed #22756 -- Added view name to technical 404 template if Http404 is raised.
Thanks Keryn Knight for the suggestion.
2014-06-30 15:34:35 -04:00
Tim Graham cf252dbea6 Fixed #8162 -- Increased Permission.name max_length to 255 characters. 2014-06-30 14:20:51 -04:00
Anubhav Joshi fd5897193f Fixed problem with refs #10811.
When 'to_field' is specified with a FK, then we need to check the pk value
the object.
2014-06-30 10:25:57 -04:00
Ian Foote 4c39c270af Add missing spaces to implicitly joined strings 2014-06-29 22:56:21 +01:00
Alex Gaynor 985ad99a71 Fixed a flake8 warning 2014-06-29 11:15:50 -07:00
Claude Paroz f12b68af71 Fixed #16184 -- Fixed multiple PostGIS types introspection
Thanks radim.blazek@gmail.com for the report and initial patch.
Testing is tricky, as the failure condition is a bit of an edge
case. inspectapp.InspectDbTests should at least guarantee non
regression.
2014-06-28 16:18:24 +02:00
Tim Graham 70576740b0 Fixed #22917 -- Fixed typo in AlterIndexTogether.describe(). 2014-06-27 10:34:48 -04:00
Tim Graham 5e9773269a Added newline to fix flake8 error. 2014-06-26 15:16:23 -04:00
Riccardo Magliocchetti 68c9a72e29 Fixed #22894 -- Made admin add related/raw ID fields widgets customizable.
Decoupled behavior and style from the RelatedFieldWidgetWrapper and
ForeignKeyRawIdWidget.
2014-06-26 15:02:42 -04:00
Claude Paroz 0d363b25b8 Fixed #22857 -- Reset translations when only .mo file changed
No need to restart the server when a translation file changes.
Refs #9523. Thanks artscoop for the report and Tim Graham for
the review.
2014-06-26 10:01:52 +02:00
Tim Graham e0cd07ec2f Fixed #22903 -- Fixed migration generation if index_together or unique_together is removed from a model. 2014-06-25 10:02:12 -04:00
Lovas Bence 9385aa3198 Fixed #22050 -- Fixed defer fields on proxy related models. 2014-06-25 07:20:18 -04:00
Tim Graham 815e7a5721 Fixed #20128 -- Made CsrfViewMiddleware ignore IOError when reading POST data.
Thanks Walter Doekes.
2014-06-25 07:08:16 -04:00
Duncan Parkes fd4ccd045c Fixed #22799 -- Made GET and POST on HttpRequest QueryDicts, and FILES a MultiValueDict.
Previously, GET, POST, and FILES on an HttpRequest were created in
the __init__ method as dictionaries. This was not something you would
usually notice causing trouble in production as you'd only see a
WSGIRequest, but in testing using the test client, calling .getlist
on GET, POST, or FILES for a request with no get/post data resulted in
an AttributeError.

Changed GET and POST on an HttpRequest object to be mutable
QueryDicts (mutable because the Django tests, and probably many
third party tests, were expecting it).
2014-06-24 22:03:22 -04:00
Duncan Parkes d68987ae25 Fixed #22897 -- Made QueryDict query_string argument optional.
Now QueryDict() is equivalent to QueryDict('') or QueryDict(None).
2014-06-24 22:02:03 -04:00
Duncan Parkes 7f4e2ef1e9 Improved documentation for QueryDict. 2014-06-24 21:40:21 -04:00
Anubhav Joshi dbbcfca476 Fixed #21668 -- Return detailed error page when SuspiciousOperation is raised and DEBUG=True
Thanks GDorn and gox21 for report.

Thanks Tim Graham for idea and review.
2014-06-24 08:55:36 -04:00
Tim Graham 150d88cc2c Restored is_anonymous() check in ModelBackend permission checking removed in refs #17903.
Thanks Florian Apolloner for raising the issue.
2014-06-24 07:09:38 -04:00
Andrew Godwin fe262c0b84 Fixed #22708: Typo in autodetector base dependency gen 2014-06-23 20:48:33 -07:00
Andrew Godwin 0b571753a8 Fixed #22889: Unneeded to_field in fk.deconstruct causing swap issues 2014-06-23 20:39:17 -07:00
Andrew Godwin 0fba4c0ed7 Fixed #22487: Don't flush out data from before normal TestCases 2014-06-23 20:25:09 -07:00
Jorge C. Leitão c33447a50c Fixed #17903 -- Modified ModelBackend to eliminate permissions on inactive users.
Thanks to @SmileyChris for the report and @timgraham for review.
2014-06-23 19:57:20 -04:00
Jorge C. Leitão 0a8c0eda2a Simplified test of contrib.auth.tests. 2014-06-23 19:30:06 -04:00
Anubhav Joshi 7f76251fb7 Refactored common code in handlers/base.py and urlresolvers.py 2014-06-23 15:27:25 -04:00
Uriel Corfa bcd2e6c697 Removed 'to_field' from ForeignKey(settings.AUTH_USER_MODEL) in admin's initial migration.
This enables using a custom user model with a primary key with a name
different than 'id'; refs #22889.
2014-06-23 13:13:45 -04:00
Anubhav Joshi 1c50d6ae2b Fixed problem introduced with #refs 13711. 2014-06-23 19:36:40 +03:00
Claude Paroz 18b3788401 Cleaned temp dir in symlinks_supported()
Refs #21482.
2014-06-23 13:27:52 +02:00
Claude Paroz 9618d68b34 Fixed #8033 -- Explained app registry error during translation setup
Thanks Tim Graham and Aymeric Augustin for the review.
2014-06-23 09:31:45 +02:00
Chris Beaven 21c496ea52 Fixed #22881 -- Better soft_applied migration detection 2014-06-23 13:36:22 +12:00
Andrew Godwin ecc06d44ed Clean up syncdb parts of migrate output if no synced apps 2014-06-22 13:03:25 -07:00
Andrew Godwin 8b878c7a64 Include swapped apps in autodetector state 2014-06-22 13:00:49 -07:00
Andrew Godwin b30d32ff24 Fixed #22875: Optimizer did not take through= into account. 2014-06-22 11:23:45 -07:00
Loic Bistuer f07735c619 Fixed #22867 -- Memoized django.utils.version.get_git_changeset().
This follows commits 80f4487 and 01399fa; original patch had to be
reverted because it wasn't Python 2.6 compatible and we need it to
be in order to build docs on the djangoproject.com server.

This fix should be replaced by @lru_cache as soon as we drop
Python 2.6 compatibility.

Thanks Florian Apolloner for the review and Alexander Schepanovski
for the original patch.
2014-06-23 00:03:58 +07:00
Claude Paroz bc19ff6479 Fixed #22793 -- Updated import location for GeometryColumns in tests
The old location was removed in cebd8753c6.
Thanks Aymeric Augustin for the report.
2014-06-21 14:10:07 +02:00
Claude Paroz cecbb71312 Prevented evaluation of a possible lazy message
As far as possible, message evaluation should not happen in field
__init__ (often run at import time).
2014-06-21 11:21:35 +02:00
Tim Graham 3425d42bf1 Fixed test from refs #22782. 2014-06-20 17:53:18 -04:00
Marc Tamlyn 2764146586 Fixed #22838 -- Deprecated ModelChoiceField.cache_choices.
Undocumented, untested and probably not even useful feature.
2014-06-20 20:29:46 +01:00
Yazhong Liu 97adfc2bf8 Added HTTP 308 status and its description. 2014-06-20 13:35:59 -04:00
Luan Pablo 407d070329 Fixed #22782 -- Added i18n attr to Sitemap class
It makes possible to have your sitemap in multiple languages when
using i18n in URLs.
2014-06-20 13:04:41 -04:00
Vlastimil Zíma 78c32f1caa Fixed #22514 -- Prevented indexes on virtual fields [postgres]. 2014-06-20 11:59:02 -04:00
Huu Nguyen fbb684d95e Fixed #22862 -- Added --noinput option to makemigrations.
Thanks artortenburger for the report.
2014-06-20 08:55:02 -04:00
Claude Paroz b67e9ed8c9 Swapped placeholders in [sql]migrate command error 2014-06-20 13:53:17 +02:00
Andrew Godwin 9f4852f649 Fixed #22863: Improve clarity of makemigrations for non-db params 2014-06-19 23:41:32 -07:00
Aymeric Augustin 01399fa0aa Revert "Fixed #22867 -- Memoized django.utils.version.get_git_changeset()."
This reverts commit 80f4487 temporarily, because that commit prevented
the djangoproject.com server from building the docs, because it still
uses Python 2.6.
2014-06-19 18:11:25 +02:00
Alexander Schepanovski 80f4487d17 Fixed #22867 -- Memoized django.utils.version.get_git_changeset().
This improves pickling speed in prelease versions of Django; refs #21430.
2014-06-19 10:46:04 -04:00
Maxime Turcotte 9996158db4 Fixed #22835 -- Deprecated NoArgsCommand. 2014-06-19 08:54:59 -04:00
Renaud Parent 87d0a3384c Fixed #22778 -- Added a model Meta option to define default_related_name.
Thanks jorgecarleitao and mmardini for reviews.
2014-06-18 13:53:07 -04:00
Andrew Godwin 2cee1d4642 Fixed #22861: Internal migrations done first so __first__ works
Thanks to Chris Beaven.
2014-06-17 23:28:35 -07:00
Andrew Godwin 09b63a7cce Fix __latest__ to actually resolve to the latest migration 2014-06-17 22:12:31 -07:00
Andrew Godwin 8d2ac948a9 Fixed #22853: Swapped models are now ignored for migration operations. 2014-06-17 17:45:38 -07:00
Anubhav Joshi 91f1b6dcdc Fixed #13711 -- Model check added to ensure that auto-generated column name is within limits of the database.
Thanks russellm for report and Tim Graham for review.
2014-06-17 16:16:02 -04:00
Andrew Godwin 66a99fa210 Merge pull request #2824 from valberg/22577
Fixed #22577: Python 3 broke on non-module migrations directory
2014-06-17 09:54:39 -07:00
Víðir Valberg Guðmundsson 3a6cb9f497 Fixed #22577: Python 3 broke on non-module migrations directory 2014-06-17 18:21:38 +02:00
Tim Graham 95cc0e15b4 Fixed #22819 -- Renamed output_type -> output_field in query expression API.
Thanks jorgecarleitao for the suggestion.
2014-06-17 11:57:16 -04:00
Andrew Godwin d359647715 Fixed #21498: Don't use a fallback language if you're en-us. 2014-06-16 20:40:13 -07:00
Andrew Godwin b22917bd50 Fixed #22851: BinaryView wasn't getting a binary default 2014-06-16 18:44:08 -07:00
Tim Graham 82c935d44c Renamed DatabaseFeature.supports_check_constraints to supports_column_check_constraints.
Thanks maxi for the suggestion.
2014-06-16 19:25:13 -04:00
Andrew Godwin 4169d4694a Ignore more blank throughs on swapped-out M2Ms 2014-06-16 15:09:27 -07:00
Andrew Godwin fa9a26745f Ignore through being None on some special cases of fields. 2014-06-16 14:58:35 -07:00
Vincent-Vega 4529af9ecf Fixed #22845 -- Correctly handled memcached default timeout value. 2014-06-16 16:34:00 -04:00
Tim Graham b341f33697 Added database migration for contrib.auth.
refs #22170.
2014-06-16 16:21:37 -04:00
Tim Graham a96dbda6d3 Fixed flake8 error. 2014-06-16 15:45:07 -04:00
Tim Graham eb8600a656 Added database migration for contrib.contenttypes.
Moved contenttypes tests to allow them to run correctly in the presence of
migrations. refs #22170.
2014-06-16 15:03:00 -04:00
Andrew Godwin 6e3ac5f474 Fixed #22847: Optimizer wasn't expecting unresolved FKs 2014-06-16 10:28:31 -07:00
Andrew Godwin 067b9668fb Fixed #22783: Make sure swappable models come first in creation 2014-06-16 10:20:05 -07:00
Andrew Godwin 2b79be2bee Fixed #22848: Ignore no-migrations errors during makemigrations only 2014-06-16 09:58:35 -07:00
Andrew Godwin f047dd2f3e Use __first__ not __latest__ for unknown app dependencies 2014-06-16 09:54:43 -07:00
Matthew Schinckel bb39037fcb Fixed #22788 -- Ensured custom migration operations can be written.
This inspects the migration operation, and if it is not in the
django.db.migrations module, it adds the relevant imports to the
migration writer and uses the correct class name.
2014-06-16 12:28:52 -04:00
Tim Graham 37a8f5aeed Added database migration for contrib.sessions.
refs #22170.
2014-06-16 10:18:42 -04:00
Andrew Godwin c8c79367a2 Fixed #22844: Duplicate SQL for SQLite FKs 2014-06-16 00:27:32 -07:00
Alex Gaynor d17a4cb037 Fixed several flake8 errors 2014-06-15 20:45:15 -04:00
Claude Paroz d7576bb27a Added database migration for contrib.redirects.
refs #22170.
2014-06-15 20:20:22 -04:00
Claude Paroz 7da16b99df Added database migration for contrib.flatpages.
refs #22170.
2014-06-15 19:29:53 -04:00
Claude Paroz ec6e2eac60 Added database migration for contrib.sites.
refs #22170.
2014-06-15 19:28:20 -04:00
Andrew Godwin c1276785f9 Fixed #22568: Better proxy model support in migrations 2014-06-15 16:01:49 -07:00
Andrew Godwin a8ce5fdc28 Fixed #22470: Full migration support for order_with_respect_to 2014-06-15 14:56:51 -07:00
Andrew Godwin a58f49d104 Persist non-schema-relevant Meta changes in migrations 2014-06-15 12:34:02 -07:00
Andrew Godwin f717ef083a Fixed #22833: Autodetector not doing through mapping correctly 2014-06-15 12:06:48 -07:00
Andrew Godwin edd9f8a7b2 Fixed #22563: Added migration to admin, fixed a few more loader issues. 2014-06-15 11:25:39 -07:00
Andrew Godwin 1e5c01c26e Improve error message for missing migrations in an app 2014-06-15 11:05:40 -07:00
Marc Tamlyn dd57b89fcb Merge pull request #2806 from jorgecarleitao/issue22826
Fixed #22826 -- Improved internal usage of Query.setup_joins.
2014-06-15 10:16:33 +01:00
Claude Paroz c24e979ece Fixed #7762 -- Hidden full script name in command error output 2014-06-14 20:01:02 +02:00
Claude Paroz 5949c2118d Restored command error behavior when called from command line
Refs #19973.
2014-06-14 18:53:33 +02:00
Alex Gaynor 2ca5fc55b0 Fixed several flake8 errors 2014-06-14 10:20:42 -04:00
Jorge C. Leitão d2cbcbcc76 Improved code style of Query.table_alias() usage. 2014-06-14 15:14:13 +02:00
Jorge C. Leitão 0b980ef857 Removed unnecessary attribute assigment to SQLCompiler. 2014-06-14 15:14:12 +02:00
Jorge C. Leitão e66896226a Fixed #22826 -- Improved internal usage of Query.setup_joins. 2014-06-14 15:14:12 +02:00
Claude Paroz f17b24e407 Converted remaining management commands to argparse 2014-06-14 13:43:44 +02:00
Claude Paroz 4b4524291a Converted test management command to argparse
Keeping backwards compatibility with test_runner.option_list is
tricky and would imply transforming an optparse.Option to an
argparse.Action. I choose to introduce a backwards incompatible
change because it only affects testing, not runtime behavior.
2014-06-14 13:43:39 +02:00
Claude Paroz 8568638603 Fixed #19973 -- Replaced optparse by argparse in management commands
Thanks Tim Graham for the review.
2014-06-14 11:17:48 +02:00
Mark Lavin 79956d0694 Fixed #22440 -- Updated ConditionalGetMiddleware to comply with RFC 2616. 2014-06-13 20:01:35 -04:00
Shai Berger 612290400f Fixed #22816 -- Corrected Oracle feature flag and fixed introspection test 2014-06-14 00:43:49 +03:00
Shai Berger 06c0e740a4 Added django.utils.six.buffer_types
and used it in the Oracle SchemaEditor. Refs #22715.
2014-06-13 13:09:51 -04:00
Xavier Fernandez 50b9313e0a Fixed #22771 -- Fixed test.Client.logout when using custom auth backend. 2014-06-13 13:03:58 -04:00
mlavin 4696cd9671 Fixed #22477 -- Removed contrib middleware from the global settings defaults.
Also added a compatibility check for changed middleware defaults.

Forwardport of d94de802d3 from stable/1.7.x
2014-06-13 12:45:56 -04:00
Jorge C. Leitão cc35bd461d Fixed #7599 -- Added get_user_permissions to ModelBackend.
Thanks to @gdub for the report and intial patch and
@charettes and @timgraham for the review.
2014-06-13 09:34:04 -04:00
Maxime Turcotte 504c89e800 Fixed #6327 -- Added has_module_permission method to BaseModelAdmin
Thanks chrj for the suggestion.
2014-06-13 09:31:40 -04:00
Greg Chapple bf743a4d57 Fixed #16087 -- Added ResolverMatch instance to test client response.
Thanks mrmachine for the suggestion.
2014-06-13 08:50:43 -04:00
Andrew Godwin 386166970c Fix test breakage from previous state fix 2014-06-12 11:12:07 -07:00
Andrew Godwin 7b17350a1b Fixed #22823 (and partly #22563) - FKs from unmigrated apps breaking state.
Thanks to bendavis78 for the test and diagnostic work.
2014-06-12 10:22:43 -07:00
Richard Eames 7beaeeed2b Fixed #22814 -- Allowed ISO-8601 [+-]hh timezone format in parse_datetime 2014-06-12 10:58:50 -06:00
Tim Graham a2cd0e12c9 Silenced deprecation warnings for refs #22811 and fixed build. 2014-06-12 09:28:36 -04:00
Tim Graham 1c58cabad7 Fixed #22811 -- Allowed setting both the old and new TEST database settings.
An ImproperlyConfigured exception will be raised they mismatch.
2014-06-12 08:17:49 -04:00
Claude Paroz 43372fc7aa Prevented markup escape in 'Welcome to Django' page
Fixes a regression introduced in 5f24cf9705. Refs #22635.
Thanks A.J. May for spotting the regression.
2014-06-12 08:42:02 +02:00
Loic Bistuer 6e8d614acd Made the vendored NamedTemporaryFile work as a context manager. Refs #22680.
This fixes a regression on Windows introduced by b7de5f5.

Thanks Tim Graham for the report and review.
2014-06-12 08:07:34 +07:00
Anubhav Joshi 42736ac8e8 Fixed #21430 -- Added a RuntimeWarning when unpickling Models and QuerySets from a different Django version.
Thanks FunkyBob for the suggestion, prasoon2211 for the initial patch,
and akaariai, loic, and charettes for helping in shaping the patch.
2014-06-11 10:03:34 -04:00
Florian Apolloner e2efc8965e Fixed #22680 -- I/O operation on closed file.
This patch is two-fold; first it ensure that Django does close everything in
request.FILES at the end of the request and secondly the storage system should
no longer close any files during save, it's up to the caller to handle that --
or let Django close the files at the end of the request.
2014-06-11 08:57:30 +02:00
Tim Schaffer a1c6cd6a16 Fixed #22780 -- Checked that LOCALE_PATHS is really a tuple 2014-06-10 23:04:24 +02:00
Moayad Mardini 868ff4e37c Fixed #22798 -- `pluralize()` now adds plural_suffix for any `1 < d < 2`
Thanks Odd_Bloke for the report.
2014-06-10 16:04:43 -04:00
Tim Graham 93d05536fd Fixed #22770 -- Removed create_superuser from post_migrate signals.
Moved logic to syncdb command for backwards compatibility.
2014-06-10 14:37:37 -04:00
Jorge C. Leitão a00b78b1e2 Fixed #17431 -- Added send_mail() method to PasswordResetForm.
Credits for the initial patch go to ejucovy;
big thanks to Tim Graham for the review.
2014-06-10 14:00:52 -04:00
Greg Chapple d8f19bb3b6 Fixed #22792 -- Updated checks for list_display_links in model admin 2014-06-10 09:35:05 -04:00
Aymeric Augustin df09d85482 Fixed #17552 -- Removed a hack for IE6 and earlier.
It prevented the GZipMiddleware from compressing some data types even on
more recent version of IE where the corresponding bug was fixed.

Thanks Aaron Cannon for the report and Tim Graham for the review.
2014-06-10 08:42:31 +02:00
Tim Graham bc0aba7786 Dropped support for SpatiaLite < 2.4. 2014-06-09 17:53:25 -04:00
Aymeric Augustin 40bfd8561d Fixed #20420 -- Normalized query counts on Oracle.
This is achieved by inserting a fake entry in connection.queries when
not releasing a savepoint (since Oracle doesn't support that operation.)

Also removed the can_release_savepoints feature that was recently added,
but is superseded by this solution.
2014-06-09 21:38:10 +02:00
Aymeric Augustin 127218b92b Simplified handling of use_debug_cursor.
Turned it from a tri-valued boolean into a regular boolean.
2014-06-09 21:35:17 +02:00
Tim Graham 6b97ae3521 Added rollback emulation to spatialite backend; refs #22487. 2014-06-09 14:14:58 -04:00
Tim Graham 4b25ebf112 Fixed flake8 error. 2014-06-09 12:00:12 -04:00
Tim Graham 3a926c0778 Tweaked order of create_test_db arguments for backwards compatibility.
Since `serialize` was backported to 1.7, it should appear before `keepdb`.
2014-06-09 11:12:28 -04:00
Claude Paroz 1aaf4053f5 Fixed formtools tests with Python 2
Fixes #19905 again.
2014-06-09 10:28:39 +02:00
Claude Paroz 96e4b52ab2 Converted Django scripts to argparse
Refs #19973.
2014-06-09 10:13:37 +02:00
Andrew Godwin 8c12d51ea2 Fixed #22487: Optional rollback emulation for migrated apps 2014-06-08 19:30:15 -07:00
Andrew Godwin 3f91238adf Fixed #22777: Add dependency on through for autodetected M2M adds 2014-06-08 17:12:59 -07:00
Aymeric Augustin 6e5651e514 Gave unique names to SpatialRefSysModels.
Prevented clashes in the app registry.

Fixed #22790. Thanks timo for the report.
2014-06-08 21:15:47 +02:00
Alex Gaynor d8f6b55aa8 Optimize is_protected_type slightly (used by force_text, which is used basically everywhere) 2014-06-07 20:36:59 -07:00
Andrew Godwin 4ce7a6bc84 Fixed #22750, #22248: Model renaming now also alters field FKs 2014-06-07 18:18:02 -07:00
Tim Graham 1e84d261d6 Removed usage of deprecated django.utils.importlib. 2014-06-07 21:10:44 -04:00
Víðir Valberg Guðmundsson f70f669941 Fixed #22749: Making SQL management commands migration aware. 2014-06-07 17:18:30 -07:00
Andrew Godwin 6fd455adfc Fixed #22436: More careful checking on method ref'ce serialization 2014-06-07 17:05:51 -07:00
Tim Graham 250e2b422b Silenced some GIS deprecation warnings; refs #22384. 2014-06-07 19:35:57 -04:00
Aymeric Augustin 5836a5771f Fixed #20815 -- Don't enforce unbuffered I/O on Python 3.
No test because this code is already deprecated (part of FastCGI support).
2014-06-07 22:33:56 +02:00
Aymeric Augustin d7f1f316bc Simplified module_has_submodule on Python >= 3.3.
Stopped using the imp module on Python >= 3.3. Refs #21628.
2014-06-07 22:02:05 +02:00
Aymeric Augustin 47a9347b98 Fixed #6992 -- Improved error when middleware omits HttpResponse.
Thanks guettli for the report.
2014-06-07 19:48:45 +02:00
Aymeric Augustin 58de495c54 Fixed #17427 -- Removed dubious definition of connections equality. 2014-06-07 17:04:10 +02:00
Aymeric Augustin d98cc41a84 Made a test compatible with Python 2 and 3. 2014-06-07 15:04:06 +02:00
Unai Zalakain 11284a63d4 Fixed #18314 -- Corrected request.build_absolute_uri() handling of paths starting with //
``HttpRequest.build_absolute_uri()`` now correctly handles paths starting with ``//``.
``WSGIRequest`` now doesn't remove all the leading slashes either,
because ``http://test/server`` and http://test//server`` aren't the same thing
(RFC2396).

Thanks to SmileyChris for the initial patch.
2014-06-07 08:59:02 -04:00
Aymeric Augustin cfcca7ccce Fixed #3711, #6734, #12581 -- Bounded connection.queries.
Prevented unlimited memory consumption when running background tasks
with DEBUG=True.

Thanks Rob, Alex, Baptiste, and others.
2014-06-07 14:37:43 +02:00
Simon Charette e2112edd9a Fixed #22772 -- Defer wizard temporary files deletion. 2014-06-06 23:41:15 -04:00
Tim Graham b5a54168f9 Fixed flake8 errors. 2014-06-06 08:29:27 -04:00
Aymeric Augustin 1181b8a4a9 Merge pull request #2764 from gchp/ticket-20550
Fixed #20550 -- Added keepdb argument to destroy_test_db
2014-06-06 14:05:41 +02:00
Claude Paroz daaeb84158 Fixed #22773 -- Forced templatize() to return unicode 2014-06-06 08:42:52 +02:00
Andrew Godwin 1fe941adb0 Prevent operation pollution by later operations of fields 2014-06-05 23:34:13 -07:00
Andrew Godwin aa12ea05ce Rewrote migration autodetector to involve actual computer science.
Fixes #22605, #22735; also lays the ground for some other fixes.
2014-06-05 23:25:35 -07:00
Andrew Godwin 5826dc5282 Merge pull request #2736 from SmileyChris/migration-run_before
Fixed #22725 - Migration.run_before does nothing
2014-06-05 20:29:26 -07:00
Aymeric Augustin e071f67b7f Replaced an explicit vendor check by a feature flag.
Forward-port of c9aedce0 from stable/1.7.x.
2014-06-06 00:32:13 +02:00
Greg Chapple 72f055e535 Fixed #20550 -- Added keepdb argument to destroy_test_db 2014-06-05 23:17:27 +01:00
Susan Tan 484f3edf1e Fixed #18400 -- Modified length template filter to return 0 for unknown variables.
Thanks Florian for the bug report, luyikei for the initial code patch, and
Bouke for the code review feedback.
2014-06-05 15:41:56 -04:00
Anubhav Joshi 5643a3b51b Fixed #10811 -- Made assigning unsaved objects to FK, O2O, and GFK raise ValueError.
This prevents silent data loss.

Thanks Aymeric Augustin for the initial patch and Loic Bistuer for the review.
2014-06-05 13:12:01 -04:00
Moayad Mardini 4f72e5f03a Fixed #21773 -- made daemon threads default in the development server.
Thanks clime for the report.
2014-06-05 12:26:24 -04:00
Konstantin Koroviev e560558ecb Fixed #22746 -- Removed background property from pre/code in admin CSS. 2014-06-05 12:03:17 -04:00
Aymeric Augustin a03d38ddd4 Added a flag for the ability to introspect nullable fields.
Previously this was conflated with another Oracle-specific behavior.
2014-06-05 17:56:56 +02:00
Anubhav Joshi 45e049937d Fixed #13776 -- Fixed ModelForm.is_valid() exception with non-nullable FK and blank=True.
Thanks peterbe for the report.
2014-06-04 07:57:19 -04:00
gyx1000 7e2c87809c Fixed #22684 -- Amended SelectDateWidget.empty_label to accept a tuple of values.
Thanks danielsamuels for the report
2014-06-04 07:23:25 -04:00
Claude Paroz fb9d8f0652 Fixed #22717 -- Auto-corrected missing ending slash in FileSystemStorage
Thanks David Fischer for the report and Moayad Mardini for the
review.
2014-06-04 08:53:17 +02:00
Alexandr Shurigin 083d285b82 Fixed #22681 -- Made TarArchive recognize leading directories properly. 2014-06-03 12:00:33 -04:00
Egor Semiguzov c5226eb72a Removed erroneous trailing comma in OLMapWidget.js. 2014-06-03 07:44:06 -04:00
Tim Graham 4445d36d47 Fixed #22384 -- Deprecated reversing URLs by dotted path. 2014-06-03 07:30:14 -04:00
Nick Presta 11f0899bbe Fixed #11776 -- Added CSS class for non-field/top of form errors.
Thanks Daniel Pope for the suggestion.
2014-06-02 15:22:15 -04:00
Craig de Stigter ce993efda8 Fixed #22690 -- Added a check for proxy models containing fields.
Removed the FieldError raised by ModelBase.__new__ in this case.
2014-06-02 09:32:38 -04:00
Tim Graham 5046c110cf Revert "Fixed #19303 -- Fixed ModelAdmin.formfield_overrides on fields with choices"
This reverts commit 9d1987d767.
2014-06-02 07:05:38 -04:00
Claude Paroz 5a504a5311 Fixed #22744 -- Fixed sqlite3 get_relations introspection with views
Thanks Tim Graham for the report and Simon Charette for the review.
2014-06-01 22:03:33 +02:00
Vincent-Vega d04e730224 Fixed #22711 -- Adjusted ordering checks to allow implicit relation fields.
refs #19195.
2014-06-01 15:36:25 -04:00
Simon Charette 7a38f88922 Fixed #22659 -- Prevent model states from sharing field instances.
Thanks to Trac alias tbartelmess for the report and the test project.
2014-06-01 15:10:38 -04:00
Fabio Rueda f384b638e2 Fixed syntax error in ogrinspect.py management command. 2014-06-01 13:19:42 -04:00
Aymeric Augustin 2a5c750ad1 Merge pull request #2726 from gchp/ticket-20550
Fixed #20550 -- Added ability to preserve test db between runs
2014-06-01 17:26:56 +02:00
Florian Apolloner 83e7555ffe Revert "Making SQL management commands migration aware."
This reverts commit cb9c9a7b58.
2014-06-01 12:00:09 +02:00
Alex Gaynor 875ce287e2 Note that the stdlib's version of pbkdf2_hmac will also be used in the upcoming Python 2.7.8 release 2014-05-31 13:50:07 -07:00
Florian Apolloner c4c2c99669 Fixed #19905 -- Fixed leakage of file descriptors in form wizard. 2014-05-30 21:58:42 +02:00
Andrew Godwin 347cab4fae Merge pull request #2744 from mmardini/MIGRATION_MODULES
Fixed #22682 -- `makemigrations` will create `MIGRATION_MODULES` package
2014-05-29 15:38:21 -07:00
Andrew Godwin 67d9f70e4c Fix test failure caused by 3149cdce32 2014-05-29 15:34:35 -07:00
Moayad Mardini 56cfa508c7 Fixed #22682 -- `makemigrations` will create `MIGRATION_MODULES` package
`makemigrations` will automatically create the package specified
in `MIGRATION_MODULES` if it doesn't already exist.

Thanks ovidiuc4 for the report.
2014-05-30 01:23:09 +03:00
Víðir Valberg Guðmundsson cb9c9a7b58 Making SQL management commands migration aware. 2014-05-29 23:03:10 +02:00
Antonis Christofides 62f9508ade Fixed #20401 -- ContentTypeManager.get_for_model reads from db_for_read.
Thanks Simon Charette and Tim Graham for the reviews.
2014-05-29 23:01:55 +07:00
Chris Beaven 45fa520187 Implement Migration.run_before
This attribute (used for reverse dependencies) was previously declared
and mentioned in the code, but never actually used.
2014-05-29 22:42:11 +12:00
Alex Gaynor 1dcc603eff Fixed several typos in Django 2014-05-28 17:39:14 -07:00
Alex Gaynor e79725cdf9 Simplified, very slightly, some code in the oracle backend 2014-05-28 17:17:58 -07:00
Andrew Godwin 61185bba72 Merge pull request #2734 from valberg/double_order_trouble
Fixed #22720 -- Migrations attempt to create _order twice.
2014-05-28 17:12:01 -07:00
Víðir Valberg Guðmundsson 6cfa2fae39 Fixed #22720 -- Migrations attempt to create _order twice. 2014-05-29 01:00:30 +02:00
Shai Berger 69337d485c Set straight the sense of 'uppercases_column_names' feature flag 2014-05-28 21:16:24 +03:00
Florian Apolloner 7e3cf3cfd2 Fixed constant_time_compare on Python 2.7.7
Python 2.7.7 includes compare_digest in the hmac module, but it requires
both arguments to have the same type. This is usually not a problem on
Python 3 since everything is text, but we have mixed unicode and str on
Python 2 -- hence make sure everything is bytes before feeding it into
compare_digest.
2014-05-28 19:51:39 +02:00
Guillaume Pannatier 32586b0ba4 Fixed #22684 -- Added `empty_label` option on `django.forms.extras.widets.SelectDateWidget`
Thanks danielsamuels for the report
2014-05-28 13:23:28 -04:00
Shai Berger fd427f1fe3 Fixed #22715: Corrected sql for defaults of BinaryField on Oracle with Python3
While at it, fixed a problem in returning empty values
(still with BinaryField/Oracle/Python3).
2014-05-28 18:57:40 +03:00
Greg Chapple b7aa7c4ab4 Fixed #20550 -- Added ability to preserve test db between runs 2014-05-28 16:22:46 +01:00
Claude Paroz e97b7a2677 Fixed #22714 -- Made contrib.gis use six-provided memoryview type
Thanks Tim Graham for the report.
2014-05-28 09:24:08 +02:00
Simon Charette d0f7c7f59a Argument to `reversed` must be a sequence on Py3. 2014-05-27 18:28:13 -04:00
Simon Charette fed2877cf1 Fix a regression introduced by f011b90363.
`django.get_version` was actually used by the module.
2014-05-27 18:23:44 -04:00
Claude Paroz f011b90363 Removed an old compatibility shim added in 1.0 2014-05-27 22:28:49 +02:00
Claude Paroz fe53bc524b Fixed #21630 -- Simplified management command discovery
Thanks Aymeric Augustin for the report end the review.
2014-05-27 22:18:51 +02:00
Aymeric Augustin 4865326f22 Fixed #22699 -- Configure default settings in some management commands.
This makes it possible to run django.setup() in management commands that
don't need a settings module. In addition it simplifies error handling.

Thanks Claude for the review.
2014-05-27 21:43:52 +02:00
Moayad Mardini 2e613ea5c5 Fixed #22675 -- makemigrations --dry-run to output migrations to stdout.
`makemigrations --dry-run` will output the complete migrations file
that would be written if it's used along with `--verbosity 3`.
2014-05-27 00:40:55 +03:00
Florian Apolloner 9d1bf8f841 Removed executeable bit from a few files. 2014-05-25 23:16:40 +02:00
Loic Bistuer b7de5f5d3f Fixed a few ResourceWarning in the test suite. Refs #22680. 2014-05-26 03:23:17 +07:00
Claude Paroz 2779c299c8 Removed code deprecated from Django 1.2 2014-05-25 21:25:23 +02:00
Claude Paroz c5d73b687d Removed comment forgotten in 3caf957ed5 2014-05-24 16:22:08 +02:00
Claude Paroz 3caf957ed5 Removed GeoWhereNode, obsoleted by GISLookup 2014-05-24 16:18:45 +02:00
Moayad Mardini 63fc91b3ca Fixed #22676 -- makemigrations --dry-run should not ask for defaults
Made the fix in InteractiveMigrationQuestioner class code, rather than
MigrationAutodetector, because --dry-run shouldn't affect whether
MigrationAutodetector will detect non-nullable fields, but the
questioner should skip the question and returns a None for default
(since that won't be used anyway) if --dry-run is used.
2014-05-24 09:56:18 -04:00
Marc Tamlyn 9fb0f5dddc Fixed #22510 -- Harden field removal to only None.
Refs #8620.

If we allow any value to remove form fields then we get name clashes
with method names, media classes etc. There was a backwards
incompatibility introduced meaning ModelForm subclasses with declared
fields called media or clean would lose those fields.

Field removal is now only permitted by using the sentinel value None.
The docs have been slightly reworded to refer to removal of fields
rather than shadowing.

Thanks to gcbirzan for the report and initial patch, and several of the
core team for opinions.
2014-05-24 13:10:50 +01:00
Claude Paroz dbb48d2bb9 Applied unicode_literals to makemessages command
This also fixes #22686 as some sort of side-effect.
2014-05-24 11:51:57 +02:00
Preston Timmons be88b062af Fixed #21357 -- Fixed test client session initialization.
The test client will now create a session when it is first accessed
if no session already exists.
2014-05-22 20:29:48 -04:00
Unai Zalakain 4dc4d12e27 Fixed #21598 -- cleaned up template loader overrides in tests
- Template loader overriding is managed with contexts.
- The test loader is a class (function based loaders entered deprecation timeline
  in 1.4).
- Template loader overrider that overrides with test loader added.
2014-05-22 18:35:16 -04:00
Moayad Mardini ad994a3c5b Fixed #22679 -- Fixed empty tuple serialization in MigrationWriter.
Thanks rockallite.wulf for the report.
2014-05-22 16:15:09 +02:00
Marc Tamlyn 3545f31bcf Merge pull request #2699 from graingert/patch-3
the SECRET_KEY is not a hash
2014-05-22 13:32:03 +01:00
Marc Tamlyn 6ab67919ac Made nested deconstruction support both forms of deconstruct()
Nested deconstruction should (silently) handle Field.deconstruct() as
well as other arbitrary deconstructable objects. This allows having a
field in the deconstruction of another field.
2014-05-22 13:23:51 +01:00
Thomas Grainger 46082339d2 the SECRET_KEY is not a hash 2014-05-22 11:19:54 +01:00
Marc Tamlyn 604162604b Added array field support for PostgreSQL.
The first part of django.contrib.postgres, including model and two form
fields for arrays of other data types.

This commit is formed of the following work:

    Add shell of postgres app and test handling.

    First draft of array fields.

    Use recursive deconstruction.

    Stop creating classes at lookup time.

    Add validation and size parameter.

    Add contained_by lookup.

    Add SimpleArrayField for forms.

    Add SplitArrayField (mainly for admin).

    Fix prepare_value for SimpleArrayField.

    Stop using MultiValueField and MultiWidget.

    They don't play nice with flexible sizes.

    Add basics of admin integration.

    Missing:
    - Tests
    - Fully working js

    Add reference document for django.contrib.postgres.fields.ArrayField.

    Various performance and style tweaks.

    Fix internal docs link, formalise code snippets.

    Remove the admin code for now.

    It needs a better way of handing JS widgets in the admin as a whole
    before it is easy to write. In particular there are serious issues
    involving DateTimePicker when used in an array.

    Add a test for nested array fields with different delimiters.

    This will be a documented pattern so having a test for it is useful.

    Add docs for SimpleArrayField.

    Add docs for SplitArrayField.

    Remove admin related code for now.

    definition -> description

    Fix typo.

    Py3 errors.

    Avoid using regexes where they're not needed.

    Allow passing tuples by the programmer.

    Add some more tests for multidimensional arrays.

    Also fix slicing as much as it can be fixed.

    Simplify SplitArrayWidget's data loading.

    If we aren't including the variable size one, we don't need to search
    like this.
2014-05-22 09:53:26 +01:00
Ramiro Morales fce6a29428 Merge pull request #2498 from ramiro/move-serverhandler
Moved ServerHandler helper class to tests.
2014-05-21 18:59:01 -03:00
Ramiro Morales d731f48ece Merge pull request #2679 from ramiro/t22421
Fixed #22421 -- Regression in fixtures loading.
2014-05-21 18:57:46 -03:00
Martin Brochhaus bb0a9a070b Fixed #20477: Allowed list of modules for FORMAT_MODULE_PATH
Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted
module path). A feature has been added to also allow a list of strings.

This is useful when using several reusable third party apps that define new
formats. We can now use them all and we can even override some of the formats
by providing a project-wide format module.
2014-05-21 07:35:47 -04:00
Loic Bistuer 27a3cfcd77 Fixed unused import. 2014-05-21 10:42:07 +07:00
Loic Bistuer 870b0a1f86 Fixed the ordering of prefetch lookups so that latter lookups can refer to former lookups.
Thanks Anssi Kääriäinen and Tim Graham for the reviews. Refs #17001 and #22650.
2014-05-21 10:30:48 +07:00
Loic Bistuer bdf3473e64 Fixed #22650 -- Fixed regression on prefetch_related.
Regression from f51c1f59 when using select_related then prefetch_related
on the reverse side of an O2O:

Author.objects.select_related('bio').prefetch_related('bio__books')

Thanks Aymeric Augustin for the report and tests. Refs #17001.
2014-05-21 10:26:04 +07:00
Denis Cornehl 3bec38888f Fixed #22557 -- ManifestStaticFilesStorage did not cleanup deleted files.
When using ManifestStaticFilesStorage, deleted static files would be
correctly cleaned up by "collectstatic --clear", but the manifest file
would still contain the stale entries.

Thanks to tedtieken for the report
2014-05-20 18:14:49 +02:00
Andrew Godwin 12c72796c3 Revert "Fixed #22645: Allow apps with no models module to still have migrations"
This reverts commit a4737bf6ae.
2014-05-20 16:53:21 +01:00
Andrew Godwin 03900a02d5 Fixed #22432: SQLite M2M repointing now works. Thanks to xelnor. 2014-05-20 16:25:59 +01:00
Andrew Godwin 125b3d4407 Fixed #22649: Beefed up quote_value 2014-05-20 15:41:01 +01:00
Andrew Godwin 4e32e47348 Merge pull request #2634 from loic/ticket22424
Fixed #22424 -- MySQL doesn't accept migrations' one-off default values ...
2014-05-20 14:25:59 +01:00
Andrew Godwin 1b07781292 Add feature for implied null (needed for Firebird backend) 2014-05-20 13:27:07 +01:00
Andrew Godwin a4737bf6ae Fixed #22645: Allow apps with no models module to still have migrations 2014-05-20 13:19:17 +01:00
Claude Paroz b8c480a12b Removed unused translations in auth tests 2014-05-20 12:21:05 +02:00
Erik Romijn ba5ddf7aed Fixed #22638 -- Changed CookieWizardView to ignore invalid cookies 2014-05-19 19:16:45 +02:00
Marc Tamlyn ecbabc216d Revert "Fixed regression from a2dd618e3b4a7472fab852da450ca5eef92a922f."
This reverts commit 5a2556afb9.
2014-05-19 14:57:06 +01:00
Claude Paroz 1a69d276bd Updated translation catalogs 2014-05-19 15:17:35 +02:00
Tim Graham b68fac7e88 Fixed #22652 -- Replaced UserModel.objects with UserModel._default_manager.
Thanks alexdlaird for the report.
2014-05-19 08:35:44 -04:00
Tim Graham 5abc811a40 Revert "Fixed #20477: Allowed settings.FORMAT_MODULE_PATH to be a list of modules."
This reverts commit 950b6de16a.
2014-05-19 08:22:46 -04:00
Claude Paroz a1f0c4c697 Removed locale dirs for single-message apps
Considering that these apps only translate their app name, it's not
worth having a whole bunch of po files just for that. The translatable
app name for those apps will be integrated in Django core catalog.
2014-05-19 14:13:01 +02:00
Martin Brochhaus 950b6de16a Fixed #20477: Allowed settings.FORMAT_MODULE_PATH to be a list of modules.
Previously the FORMAT_MODULE_PATH setting only accepted one string (dotted
module path).

This is useful when using several reusable third party apps that define new
formats. We can now use them all and we can even override some of the formats
by providing a project-wide format module.
2014-05-19 07:59:13 -04:00
Claude Paroz 7999ed9b69 Updated Django makemessages process
makemessages should now automatically distribute translatable
strings in the proper locale files, for Django too
(see 50a8ab7cd1).
2014-05-19 09:30:26 +02:00
Claude Paroz 813ded775d Merge pull request #2682 from alimony/welcome_page_local_02
Fixed #22635 -- Make "It worked!" page localizable
2014-05-19 08:58:18 +02:00
Markus Amalthea Magnuson 5f24cf9705 Fixed #22635 -- Made "It worked!" page localizable. 2014-05-19 01:05:19 +02:00
Tim Graham c7a4ae94a0 Removed some unnecessary exception naming; thanks claudep. 2014-05-18 17:42:03 -04:00
Esau Rodriguez ec9043ab2f Fixed #21799 - Modified loaddata --ignorenonexistent to ignore models. 2014-05-18 15:52:07 -04:00
Florian Apolloner 5a2556afb9 Fixed regression from a2dd618e3b. 2014-05-18 20:35:06 +02:00
SaeX e3a9714ce3 Added "/" divider for DATE(TIME)_INPUT_FORMATS for Dutch locale.
Dutch ('nl-NL' and 'nl-BE') has several valid input formats;
see http://nl.wikipedia.org/wiki/Datum_(dagtekening).

Thanks Erik Romijn for review.
2014-05-18 12:49:14 -04:00
Loic Bistuer 1d3d01b4f7 Fixed #22424 -- Fixed handling of default values for TextField/BinaryField on MySQL.
Thanks syphar for the review and suggestions.
2014-05-18 11:58:16 +07:00
Ramiro Morales 862e1ff234 Fixed #22421 -- Regression in fixtures loading.
Loading fixtures were failing since the refactoring in 244e2b71f5 for
inheritance setups where the chain contains abstract models and the
root ancestor contains a M2M relation.

Thanks Stanislas Guerra for the report.

Refs #20946.
2014-05-17 17:36:45 -03:00
Markus Amalthea Magnuson acb20016c0 Fixed #6668 -- Optimized utils.text wrap function
This fixes a failing test after applying an optimization of the
utils.text.wrap function by user SmileyChris.
2014-05-17 20:42:58 +02:00
Alex Gaynor b6b873d2ad Fixed several flake8 errors, including one where a test wouldn't be run 2014-05-17 09:54:34 -07:00
Raphaël Barrois 6aacb4c991 Fixed #22626 -- Allow BinaryField defaults with SQlite.
Also fixes a slight issue in sqlite3.schema._remake_table where
default values where quoted with "column name" quoting rules.

Reference for quoting: http://www.sqlite.org/lang_expr.html

Thanks Shai Berger for the review. Refs #22424.
2014-05-17 22:32:17 +07:00
Baptiste Mispelon a0d5970d44 Fixed contrib.gis tests breaking in some edge cases.
The tests would error out with an ImproperlyConfigured error
if the user had psycopg installed but not geos.
Thanks to mcgohier for the report.
2014-05-17 15:01:06 +02:00
Marc Tamlyn a2dd618e3b Fixed #22648 -- Transform.output_type should respect overridden custom_lookup and custom_transform.
Previously, class lookups from the output_type would be used, but any
changes to custom_lookup or custom_transform would be ignored.
2014-05-17 12:26:15 +02:00
Florian Apolloner 11932e978f Merge pull request #2346 from Markush2010/ticket21905
Fixed #21905 -- Add info message if DateField or TimeField use a fixed value
2014-05-17 12:09:04 +02:00
Florian Apolloner 9a4bf72fbd Fixed jenkins breakage, apparently migrations need a models module.
Workaround for now, Andrew will look into it.
2014-05-17 10:15:58 +02:00
Unai Zalakain ebb0279f4a Fixed #16245 -- Included traceback in send_robust()'s response
Exceptions from the (receiver, exception) tuples returned by
``send_robust()`` now have always their traceback attached as their
``__traceback__`` argument.
2014-05-16 18:41:40 -04:00
Aymeric Augustin 1109ebd7b3 Optimized make_aware/naive by removing redundant checks. Refs #22625.
Also added tests with pytz and removed misplaced tests.
2014-05-16 23:12:59 +02:00
Aymeric Augustin fa89acf1d0 Fixed #22625 -- Normalized make_aware/naive errors.
Also added tests for is/make_aware/naive.

Thanks Tom Michaelis for the report.
2014-05-16 22:52:10 +02:00
Tim Graham 1efb2e73bf Fixed typo. 2014-05-16 16:39:12 -04:00
Shai Berger 6bb6df2943 Fix storing of binary fields and unicode textfields for Oracle/Python3 2014-05-16 20:08:52 +03:00
Markus Holtermann 9d8c73f6a1 Fixed #21905 -- Add info message if DateField or TimeField use a fixed value 2014-05-16 18:59:31 +02:00
Jorge C. Leitão 2e364a0aac Fixed #15716 - Authentication backends can short-circuit authorization.
Authorization backends can now raise PermissionDenied in "has_perm"
and "has_module_perms" to short-circuit authorization process.
2014-05-16 12:57:38 -04:00
Stas Rudakou ebd70d4d00 Fixed #22266 - quote PK before redirecting away from add_view (django.contrib.admin) 2014-05-16 18:33:17 +02:00
Vlad Starostin 1be03aff5c Fixed #18389 -- Fixed the way contribute_to_class is called
Now this method is only called only if the object is an instance.
This allows to have field classes as model class attributes.
2014-05-16 10:40:07 -04:00
Russell Keith-Magee 2c176eb95c Refs #21798 - Modified error number to provide room for future expansion. 2014-05-16 15:41:17 +02:00
Moayad Mardini 393ddc10a7 Fixed #22531 -- Added tree.Node.__repr__ and tests for the class.
While Node class has a useful `__str__`, its `__repr__` is not that
useful. Added a `__repr__` that makes use of the current `__str__`.
This is especially useful since the more popular `Q` class inherits
`tree.Node`. Also created new tests that cover most of `Node` class
functionality.
2014-05-16 09:30:25 -04:00
Erik Romijn 424fe76349 Fixed #22579 -- Corrected validation for email to reject trailing slash
Thanks to Claude Paroz for the report and patch and Tomasz
Paczkowski for the review.
2014-05-16 15:13:11 +02:00
Stephen Burrows d64f192df1 Fixed #22628 -- Took initial forms into account when combining FormSet.min_num and FormSet.extra.
Forwardport of 79f15ab1ef from stable/1.7.x
2014-05-16 06:38:24 -04:00
Marc Tamlyn cebd8753c6 Remove old compatibility shims from d.c.gis. 2014-05-16 12:11:35 +02:00
Claude Paroz f5d4b45df1 Fixed #21634 -- Prevented hiding ImproperlyConfigured when command not found
Thanks nikolay.v.golub@gmail.com for the report.
2014-05-16 12:08:31 +02:00
Daniel Pyrathon cb15231888 Fixed #21798 -- Added check for DateTime mutually exclusive options
Added DateTimeCheckMixin to avoid the use of default, auto_now, and
auto_now_add options together. Added the fields.E151 Error that is raised
if one or more of these options are used together.
2014-05-16 05:57:19 -04:00
mbacho 8a9d54aa69 Fixed typo in multipartparser.py 2014-05-16 05:34:40 -04:00
Claude Paroz e520a73eee Harmonized some PEP 0263 coding preambles 2014-05-15 19:58:41 +02:00
Tim Martin 27aa85246a Fixed #20897 -- Added make_cursor() for consistent cursor creation
In django.db.backends.BaseDatabaseWrapper, pulled the creation of
cursors in the non-debug case into a separate method, in order to
make behavior more consistent when overriding the cursor creation
in derived classes.
2014-05-15 07:55:36 -04:00
Anders Steinlein 4ef10f245a Fixed #17642 -- Added min_num support to modelformsets, inlines, and the admin.
Thanks Stephen Burrows for work on the patch as well.

Forwardport of 2914f66983 from stable/1.7.x
2014-05-15 07:25:35 -04:00
Collin Anderson 8a2f04db91 typo: urlaprse -> urlparse 2014-05-14 15:00:57 -04:00
Erik Romijn 255449c1ee Added additional checks in is_safe_url to account for flexible parsing.
This is a security fix. Disclosure following shortly.
2014-05-14 10:19:48 +02:00
Aymeric Augustin 3800f63721 Dropped fix_IE_for_vary/attach.
This is a security fix. Disclosure following shortly.
2014-05-14 10:19:48 +02:00
Julen Ruiz Aizpuru 5eb81ce445 Fixed #22533 -- Added label_suffix parameter to form fields.
Fields can now receive the `label_suffix` attribute, which will override
a form's `label_suffix`.

This enhances the possibility to customize form's `label_suffix`, allowing
to use such customizations while using shortcuts such as
`{{ form.as_p }}`.

Note that the field's own customization can be overridden at runtime by
using the `label_prefix` parameter to `BoundField.label_tag()`.

Refs #18134.
2014-05-13 09:09:33 -04:00
Ramiro Morales a9b7f31bfc Completed long overdue sqlinitialdata deprecation. 2014-05-11 23:15:59 -03:00
Matt Robenolt 393c0e2422 Fixed #20936 -- When logging out/ending a session, don't create a new, empty session.
Previously, when logging out, the existing session was overwritten by a
new sessionid instead of deleting the session altogether.

This behavior added overhead by creating a new session record in
whichever backend was in use: db, cache, etc.

This extra session is unnecessary at the time since no session data is
meant to be preserved when explicitly logging out.
2014-05-11 21:42:26 -03:00
Rainer Koirikivi a75324c654 Fixed #14226 -- Dependency calculation for complex M2M relations.
`sort_dependencies` incorrectly interpreted 'complex' M2M relations
(with explicit through models) as dependencies for a model. This caused
circular complex M2M relations to be unserializable by dumpdata.

Thanks to aneil for the report and outofculture for initial tests.
2014-05-11 19:50:01 -03:00
Claude Paroz 4cf82e5bcf Fixed #21685 -- Displayed app verbose name in admindocs model index 2014-05-10 18:09:07 +02:00
Aymeric Augustin f574220f09 Fixed #22508 -- Avoided overwriting select_related.
Previously, known related objects overwrote related objects loaded
though select_related. This could cancel the effect of select_related
when it was used over more than one level.

Thanks boxm for the bug report and timo for bisecting the regression.
2014-05-10 16:39:20 +02:00
Aymeric Augustin fb90b7cda2 Adjusted refactoring of vendor checks.
Thanks Shai for the thorough review.
2014-05-10 14:40:42 +02:00
Stephen Burrows a5de0df58b Fixed #22502 -- Fixed microseconds/default/form interaction
Made explicit lack of microsecond handling by built-in datetime form
fields. Used that explicitness to appropriately nix microsecond
values in bound fields. Thanks Claude Paroz for the review.
2014-05-10 10:56:39 +02:00
Malcolm Box 66880e4cd1 Fixed #22606 -- Locmemcache has_key() failed for infinite cache expiry
Refactored cache expiry logic for Locmemcache to make consistent across
all places where accessed, and correctly handle None as expiry time.
2014-05-09 18:35:07 +02:00
Andrew Godwin 5400b29ebf Fixed #22325: Ignore __first__ dependencies to your own app 2014-05-08 21:38:56 -07:00
Andrew Godwin 5182efce8d Fixed #22563: Ignore AUTH_USER_MODEL errors in from_state 2014-05-08 21:34:30 -07:00
David Szotten 7fe60ae64a Fixed #22588 -- Fix RegexValidator __eq__
Compare parameters instead of re.pattern instances, and add the other
parameters to the comparison. Also add a __ne__ to make assertNotEqual
work properly.
2014-05-08 19:51:15 -07:00
Aymeric Augustin 99d9fa329a Added feature flags for introspection capabilities. 2014-05-08 22:11:20 +02:00
Aymeric Augustin cff59bedc2 Split ignores_nulls_in_unique_constraints feature.
Oracle and SQL Server don't have exactly the same limitations. It's
worth treating them differently.
2014-05-08 22:11:20 +02:00
Aymeric Augustin c70a61eb49 Replaced vendor checks by three feature flags. 2014-05-08 22:11:15 +02:00
Aymeric Augustin b1432bfc22 Appeased flake8. 2014-05-08 21:49:54 +02:00
Claude Paroz fc32e9c0d9 Removed unused imports in makemigrations 2014-05-08 19:39:43 +02:00
Andrew Godwin b25aee3b7b Fixed #22476: Couldn't alter attributes on M2Ms with through= set 2014-05-08 10:34:24 -07:00
Ramiro Morales 5ea34f3f86 Restored site header text in password reset view.
It's the one shown when the optional integration described in
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-a-password-reset-feature
is used.

Follow-up to commits 6f470650d0 and 1d42a86ec7, together they fix
different small UI regressions after a962286b74.

Refs #21293.
2014-05-07 23:12:58 -03:00
Andrew Godwin 5a917cfef3 Fixed #22496: Data migrations get transactions again! 2014-05-07 14:28:34 -07:00
Andrew Godwin e9a456d11b Fixed #22581: Pass default values for schema through get_db_prep_save() 2014-05-07 13:46:23 -07:00
Andrew Godwin fc974313b8 Fixed #22563: Better error message when trying to change AUTH_USER_MODEL
You're not allowed to do this after you've made migrations; see ticket
for more details.
2014-05-07 13:05:11 -07:00
Andrew Godwin f9d7e18dc5 Fixed #22576: Ensure makemigrations doesn't touch the database. 2014-05-06 22:41:59 -07:00
Andrew Godwin 6944418277 Fixed #22337: FileSystemStorage marked as deconstructible and tested. 2014-05-06 22:23:23 -07:00
Tim Graham 4492ea5475 Fixed #22586 -- Added LANGUAGE_SESSION_KEY to __all__.
Thanks david.fischer.ch at gmail.com for the report.
2014-05-06 19:47:22 -04:00
Claude Paroz da9cf53cb5 Fixed #22564 -- Prevented unneeded bytestrings in migrations
In some cases, this could lead to migrations written with Python 2
being incompatible with Python 3.
Thanks Tim Graham for the report and Loïc Bistuer for the advices.
2014-05-06 09:13:07 +02:00
Claude Paroz 12474dacef Added a bunch of missing unicode_literals
Refs #22564.
2014-05-06 09:13:07 +02:00
Ben Davis df60db0e78 Fixed #22570 -- Made Form.__getitem__ KeyError more descriptive. 2014-05-05 20:01:15 -04:00
Loic Bistuer 942556df2f Fixed #22572 -- override_settings(ROOT_URLCONF) didn't clear urlresolvers._urlconfs.
Thanks Anubhav Joshi and Tim Graham for the reviews.
2014-05-05 19:29:27 +07:00
Anssi Kääriäinen 3b7c66a3ac Fixed #22466 -- ordering by reverse foreign key
Ordering by reverse foreign key was broken by custom lookups patch
(commit 20bab2cf9d).

Thanks to everybody who helped solving this issue. Special thanks to
Trac alias takis for reporting this.
2014-05-05 15:28:07 +03:00
Jakub Roztocil 7131e14d00 Fixed #22489 -- missing implemenation for search lookup
When custom lookups were added, converting the search lookup to use
the new Lookup infrastructure wasn't done.

Some changes were needed to the added test, main change done by
committer was ensuring the test works on MySQL versions prior to 5.6.
2014-05-05 14:36:15 +03:00
Anssi Kääriäinen 5e1f4656b9 Fixed #22429 -- Incorrect SQL when using ~Q and F 2014-05-05 13:02:11 +03:00
Claude Paroz faa8c71fd9 Moved misplaced transaction.atomic from 0dce44e16b
Thanks Florian Apolloner for noticing the issue and Aymeric
Augustin for the expertise.
Refs #22540.
2014-05-03 23:44:40 +02:00
Tim Graham 3818d96426 Fixed #22435 -- Prevented adding a ManyToManyField from prompting for a default.
Thanks andrewsg for the report.
2014-05-02 20:46:47 -04:00
Claude Paroz 142c27218a Fixed #22565 -- Prevented pgettext_lazy crash with bytestring input
Thanks ygbo for the report.
2014-05-02 19:33:22 +02:00
Loic Bistuer d1799233f4 Fixed clash caused by the newly introduced -e shorthand for makemessages --exclude.
This fixes a regression caused by 0707b82. Refs #22328.
2014-05-02 23:07:17 +07:00
Claude Paroz 0dce44e16b Fixed #22540 -- Made _create_object_from_params() call create()
So as the save step is centralized in create(), especially useful
when customizing behavior in subclasses.
Thanks craig.labenz@gmail.com for the report.
2014-05-02 09:06:15 +02:00
Chris Beaven a0c4b8465d Fix migration autodector to work correctly with custom deconstructed values 2014-05-02 15:08:19 +12:00
Yehonatan Daniv e2e4cdba11 Fixed #22539 -- Copied exclude argument in Model.full_clean() to prevent side effects. 2014-05-01 09:28:11 -04:00
Tim Graham 45c2d1f5d9 flake8 fixes. 2014-04-30 18:33:46 -04:00
Andrew Godwin e049c88603 Cleanup failing test w/contenttypes and remove useless graph load 2014-04-30 15:11:52 -07:00
Andrew Godwin 8f6dff372b Fixed #22485: Include all unmigrated apps in project state by default. 2014-04-30 12:25:12 -07:00
Simon Charette 24ec9538b7 Fixed #19195 -- Allow explicit ordering by a relation `_id` field.
Thanks to chrisedgemon for the report and shaib, akaariai and
timgraham for the review.
2014-04-30 14:23:19 -04:00
Doug Beck a5f6cbce07 Refactored DjangoTranslation class
Also fixes #18192 and #21055.
2014-04-30 18:36:25 +02:00
Claude Paroz 7c54f8cced Fixed #22474 -- Made migration recorder aware of multiple databases
Thanks Tim Graham for the review.
2014-04-30 16:53:20 +02:00
Tim Graham d9c272b22f Removed unused import. 2014-04-30 07:23:39 -04:00
Bruno Ribeiro da Silva 83413c53d2 Fixed #22511 -- Added args to migrations management commands. 2014-04-30 07:15:03 -04:00
Simon Charette a2340ac6d6 Use the new implementation of `six.with_metaclass`.
No more `NewBase` horrors.

Thanks to bendavis78 for his work on merging this into six.
2014-04-29 09:43:08 -04:00
Ramiro Morales 2df7238512 Removed bogus, ineffective 'U' flag from codecs.open() call. 2014-04-29 07:46:54 -03:00
Tim Graham aabceadd7d Revert "Fixed #15179 -- middlewares not applied for test client login()"
This reverts commit 4fdd51b732.

See the ticket for concerns with this implementation; it will be revisited.
2014-04-28 18:41:36 -04:00
Alex Gaynor 2bcb8bfc8d Fix many many typos in comments throughout the codebase 2014-04-26 10:18:45 -07:00
Aymeric Augustin 8b5b199e20 Fixed #3214 -- Stopped parsing SQL with regex.
Avoided introducing a new regex-based SQL splitter in the migrations
framework, before we're bound by backwards compatibility.

Adapted this change to the legacy "initial SQL data" feature, even
though it's already deprecated, in order to facilitate the transition
to migrations.

sqlparse becomes mandatory for RunSQL on some databases (all but
PostgreSQL). There's no API to provide a single statement and tell
Django not to attempt splitting. Since we have a more robust splitting
implementation, that seems like a good tradeoff. It's easier to add a
new keyword argument later if necessary than to remove one.

Many people contributed to both tickets, thank you all, and especially
Claude for the review.

Refs #22401.
2014-04-26 17:46:23 +02:00
Ana Krivokapic 0707b824fe Fixed #22328 -- Added --exclude option to compilemessages and makemessages. 2014-04-26 17:07:44 +07:00
Aymeric Augustin 3033a7193a Fixed #21166 -- Reset errors_occurred flag after commit and rollback. 2014-04-25 22:45:11 +02:00
Tim Graham 9e7f86b890 Fixed #22515 -- Fixed the object_id of the LogEntry that's created after a user password change in the admin.
Thanks ross at servercode.co.uk for the report.
2014-04-25 08:20:25 -04:00
Aymeric Augustin e368912902 Set some transaction-related feature flags on SQLite.
Refs #22496.
2014-04-25 11:43:20 +02:00
Shai Berger 843613add4 Fixed #22498 -- constraint name was not quoted in FK creation SQL 2014-04-25 01:30:43 +03:00
Shai Berger 53d97e4fe3 Made sure cursor.close() does not complain if cursor is already closed on Oracle
Refs #22483
2014-04-25 00:36:40 +03:00
Aymeric Augustin 25209715d4 Prevented a crash in the cursor wrappers on Oracle.
Fixed #22483 (again).

Forwardport of 5cd6429620 from stable/1.7.x
2014-04-24 09:14:42 -04:00
Aymeric Augustin b0f4eecfa7 Ignored repeated calls to connection.close().
Forwardport of 9bbb43dd1a from stable/1.7.x
2014-04-24 09:14:26 -04:00
Kevin Christopher Henry 91afc00513 Fixed #21157 -- Fixed problems with ResolverMatch
- Fixed bug in get_callable() that caused resolve() to put a string
  in ResolverMatch.func.
- Made ResolverMatch.url_name match the actual url name (or None).
- Updated tests that used the string value in ResolverMatch.func, and
  added regression tests for this bug.
- Corrected test urls whose dummy view paths caused failures (behavior
  that was previously masked by this bug).
2014-04-23 20:12:34 -04:00
Aymeric Augustin 0aa4c6c391 Used the same instance of atomic for entry and exit.
Since all state is maintained on the connection at this time and none in
the atomic, it doesn't matter, but it could introduce some subtle bugs
if the implementation changed in the future.
2014-04-23 21:44:36 +02:00
Aymeric Augustin e74d2183c2 Wrapped migrations in a transaction only on DBs with transactional DDL. 2014-04-23 21:44:36 +02:00
Claude Paroz 3a435a057c Set compile messages options as class variable
Refs #18714. Same logic as options for makemessages commands.
2014-04-23 15:15:03 +02:00
Malcolm Box af5f688392 Fixed #22495 -- Locmem cache.add() failed with infinite timeouts
cache.add() incorrectly succeeded when there was an existing key
with an infinite (None) timeout.
2014-04-23 14:49:46 +02:00
Claude Paroz 2ffa6ca73a Added Spatialite support to the new migration framework
Refs #22451.
2014-04-23 13:46:11 +02:00
Claude Paroz 48c4ea4146 Used migration framework in GIS test tearDown 2014-04-23 13:45:41 +02:00
Preston Timmons 3c06b2f2a3 Fixed #22486 -- Restored the ability to reverse views created using functools.partial.
Regression in 8b93b31487.

Thanks rcoup for the report.
2014-04-23 07:27:52 -04:00
Alex Gaynor 58176dee88 Use the stdlib's compare_digest for constant time comparisons when available 2014-04-22 14:45:00 -07:00
Florian Apolloner f286721f7f Fixed #22426 -- Added support old-style d.c.messages format.
Forward ported code from 1.5 that adds backwards compatibility with legacy message length.
See commit 9e7183073f for details.

Thanks to Ofir Ovadia for the initial patch.
2014-04-22 10:46:18 +02:00
Erik Romijn 75c0d4ea3a Fixed queries that may return unexpected results on MySQL due to typecasting.
This is a security fix; disclosure to follow shortly.
2014-04-21 18:11:26 -04:00
Aymeric Augustin c083e3815a Prevented leaking the CSRF token through caching.
This is a security fix. Disclosure will follow shortly.
2014-04-21 18:11:26 -04:00
Tim Graham 8b93b31487 Fixed a remote code execution vulnerabilty in URL reversing.
Thanks Benjamin Bach for the report and initial patch.

This is a security fix; disclosure to follow shortly.
2014-04-21 18:11:26 -04:00
Claude Paroz ab90c4707b Fixed table cleanup in GIS migration tests 2014-04-21 23:08:00 +02:00
Claude Paroz 1667e736a7 Fixed PostGIS remove_field implementation
Fixed bad code introduced in 2f9d1576e8.
2014-04-21 22:42:11 +02:00
Claude Paroz 2f9d1576e8 Fixed removal of GIS column in PostGIS 1.x migration
Refs #22481.
2014-04-21 21:17:14 +02:00
Claude Paroz fb09a489ca Fixed adding new GIS column in PostGIS 1.x migration
Refs #22451.
2014-04-21 20:58:09 +02:00
Florian Apolloner 405b13fe83 Fixed migrate when called inside a transaction.
This is useful for tests manually calling migrate inside a testcase,
for normal usage this should make no difference, since there is no
surrounding transaction after all. If there is one we still try to
leave the transaction in a useable state (for postgres at least).

If this commit turns out to be causing issues, settings savepoint=False
is probably the right fix :)
2014-04-21 15:37:12 +02:00
Aymeric Augustin 428c0bbe1b Appeased flake8 2.1.0. 2014-04-21 12:27:34 +02:00
Tim Graham 471fb04a30 Fixed flake8 errors. 2014-04-20 13:08:04 -04:00
Andrew Gorcester 956bd64424 Fixed #22397 -- Issues removing M2M field with explicit through model
Changed the migration autodetector to remove models last so that FK
and M2M fields will not be left as dangling references. Added a check
in the migration state renderer to error out in the presence of
dangling references instead of leaving them as strings. Fixed a bug
in the sqlite backend to handle the deletion of M2M fields with
"through" models properly (i.e., do nothing successfully).

Thanks to melinath for report, loic for tests and andrewgodwin and
charettes for assistance with architecture.
2014-04-18 16:44:47 -04:00
Claude Paroz 275811a93c Adapted fixture read mode to file type
Binary mode added in ed532a6a1e is not supported by ZipFile.
Refs #22399.
2014-04-18 18:54:46 +02:00
Claude Paroz ed532a6a1e Fixed #22399 -- Forced fixture reading in binary mode
This might help on systems where default encoding is not UTF-8 (and
on Python 3).
Thanks bacilla for the report.
2014-04-18 17:55:35 +02:00
amatellanes 8394e570ba Fixed #22465 -- New assertion assertJSONNotEqual 2014-04-18 15:11:08 +07:00
Simon Charette 0d397e5a5b Revert "Fixed #22397 -- Issues removing M2M field with explicit through model."
This reverts commit 00e3b9a2a9.

It's causing a regression when tested with the proxy_model_inheritance tests.
2014-04-18 01:27:30 -04:00
Moayad Mardini 214d1e1b0f Fixed #22454 - Changed compatibility warning hint
The warning hint of `_check_test_runner` of 1.6 compatibility had a link
to a general release note. The link should be edited to refer the
relevant "Backwards incompatible changes in 1.6" section that documents
the cause and the possible solutions and workarounds of the warning.
2014-04-17 20:41:25 -04:00
Tim Graham 11e30b684d Fixed a KeyError on login with legacy sessions; refs #21649.
Thanks Loic for the report.
2014-04-17 19:57:20 -04:00
Donald Stufft ecff136f69 Merge pull request #2582 from alex/stdlib-pbkdf2hmac
Use the stdlib's PBKDF2 implementation when available.
2014-04-17 16:01:17 -04:00
Claude Paroz c082f3c74c Fixed #22456 -- Replaced 900913 EPSG code by 3857 in some tests
3857 is now the official EPSG code for the Google spherical mercator
projection and some recent versions of GDAL do not recognize 900913
any longer.
Thanks Tim Graham for the report and initial patch.
2014-04-17 21:18:07 +02:00
Alex Gaynor 7283c21173 For another day 2014-04-17 11:07:19 -07:00
Alex Gaynor 21a1fddcc4 Typo fix 2014-04-17 11:04:57 -07:00
Alex Gaynor cb68eb3e6d Use the stdlib's PBKDF2 implementation when available.
This is a bit faster than ours, which is good, because it lets you increase
the iteration counts.

This will be used on Python 3.4+, and, pending the acceptance of PEP466, on
newer Python 2.7s.
2014-04-17 11:02:42 -07:00
Andrew Gorcester 00e3b9a2a9 Fixed #22397 -- Issues removing M2M field with explicit through model.
Changed the migration autodetector to remove models last so that FK
and M2M fields will not be left as dangling references. Added a check
in the migration state renderer to error out in the presence of
dangling references instead of leaving them as strings. Fixed a bug
in the sqlite backend to handle the deletion of M2M fields with
"through" models properly (i.e., do nothing successfully).

Thanks to melinath for report, loic for tests and andrewgodwin and
charettes for assistance with architecture.
2014-04-17 12:54:35 -04:00
Tim Graham 47927eb786 Revert "Fixed #22401 -- Deprecated regular expression parsing of initial SQL in favor of installing sqlparse."
This reverts commit 071c933775.

This introduced a regression on MySQL and custom SQL is deprecated.
2014-04-16 21:03:22 -04:00
Justin Hamade a13df671a5 Fixed #22434 -- Retain ordering on related sliced subqueries.
Thanks maciej.pawlisz for the report, and charettes for the review.
2014-04-16 17:57:11 -04:00
Simon Charette 79f05616fb Fixed flake8 warnings introduced in recent commits. 2014-04-16 16:49:37 -04:00
Motiejus Jakštys 0e45669fa9 Fixed #22460 -- Explicity remove constraints when dropping a related field. 2014-04-16 15:38:31 -04:00
Marc Egli 0bcc92c691 Fixed #22356 -- Added a check to make sure unique_together fields are local. 2014-04-14 16:49:40 -04:00
Jacob R. Rothenbuhler 17c1884456 Fixed #22369 -- Added count parameter to assertTemplateUsed 2014-04-14 15:55:10 -04:00
Simon Charette 72d3889db4 Fixed #22350 -- Consistently serialize bytes and text in migrations.
Thanks to @treyhunner and Loïc for their suggestions and review.
2014-04-13 18:22:26 -04:00
valtron d3b71b976d Fixed #21760 -- prefetch_related used an inefficient query for reverse FK.
Regression introduced by commit 9777442. Refs #21410.
2014-04-13 00:34:16 +07:00
Claude Paroz 3417ba0309 Also allowed a non-overridden setting to be deleted
Refs #20032, #18824. Thanks ztorstri at gmail.com for the report.
2014-04-12 15:33:22 +02:00
Claude Paroz 3e3a7372f5 Fixed #22102 -- Made SimpleTestCase tests run before unittest.TestCase ones
Thanks aptiko for the reporti and Tim Graham for the review.
2014-04-12 11:42:06 +02:00
Aymeric Augustin 476db08b16 Improved a comment. Thanks intgr for the report. 2014-04-11 23:01:00 +02:00
Aymeric Augustin ee837b9a22 Increased robustness of 58161e4e. Refs #22291. 2014-04-10 21:22:47 +02:00
Aymeric Augustin 8176150850 Fixed #21202 -- Maintained atomicity when the server disconnects.
Thanks intgr for the report.

This commit doesn't include a test because I don't know how to emulate a
database disconnection in a cross-database compatible way.

Also simplified a 'backends' test that was constrained by this problem.
2014-04-10 21:22:47 +02:00
Aymeric Augustin 25860096f9 Fixed #21239 -- Maintained atomicity when closing the connection.
Refs #15802 -- Reverted #7c657b24 as BaseDatabaseWrapper.close() now
has a proper "finally" clause that may need to preserve self.connection.
2014-04-10 20:57:43 +02:00
Aymeric Augustin 3becac8484 Fixed #22321 -- Wrapped exceptions in _set_autocommit.
Refs #21202.
2014-04-10 20:16:12 +02:00
John Paulett b5a9166f7e Fixed #22364 -- Sanitized getpass input in changepassword.
Python 2 getpass on Windows does not accept unicode, even
when containing on ASCII characters. Related #190807.
2014-04-10 13:15:37 -04:00
Tomasz Wysocki ea5a984704 Refactored some code in SelectDateWidget. 2014-04-10 13:03:23 -04:00
Tim Graham 395d75ea6b Fixed #22194 -- Added --list-tags option to check command.
Thanks Elvard for the patch.
2014-04-10 09:43:55 -04:00
Tim Graham b513fa5fc6 Fixed #22195 -- Used constants to define built-in tags for check framework.
Thanks Elvard for the patch.
2014-04-10 08:45:48 -04:00
Shai Berger f095356ba2 Fixed #22343 -- Disallowed select_for_update in autocommit mode
The ticket was originally about two failing tests, which are
fixed by putting their queries in transactions.

Thanks Tim Graham for the report, Aymeric Augustin for the fix,
and Simon Charette, Tim Graham & Loïc Bistuer for review.
2014-04-10 03:04:51 +03:00
julien 'pouete' Godin 071c933775 Fixed #22401 -- Deprecated regular expression parsing of initial SQL in favor of installing sqlparse. 2014-04-09 19:25:07 -04:00
Aymeric Augustin 5f2f47fdfc Fixed #21553 -- Ensured unusable database connections get closed. 2014-04-09 22:41:33 +02:00
Aymeric Augustin 2791fbf59d Used more specific test assertions. 2014-04-09 22:20:22 +02:00
e0ne 2aaa045c61 Fixed #13408 -- Deprecated silent unpacking exception passing in for template tag.
Thanks peterbe for the suggestion.
2014-04-08 13:55:17 -04:00
Tim Graham 3cba90f22a Fixed #21084 -- Used proxy model's content type for admin log entries.
(the previous commit included only the test)
2014-04-07 09:04:49 -04:00
Tomasz Wysocki 78623d253b Removed casting to bool just before negation. 2014-04-07 08:30:05 -04:00
Anubhav Joshi cd914e31c9 Fixed #21977 -- Deprecated SimpleTestCase.urls 2014-04-06 17:33:43 -04:00
Claude Paroz 0a65da941c Fixed #22236 -- Removed inappropriate usage of signals
Thanks Aymeric Augustin for the report and Tim Graham for the review.
2014-04-05 21:00:31 +02:00
Tim Graham fd23c06023 Fixed #21649 -- Added optional invalidation of sessions when user password changes.
Thanks Paul McMillan, Aymeric Augustin, and Erik Romijn for reviews.
2014-04-05 12:50:51 -04:00
Tomasz Wysocki c28beb4291 Refactored and commented strip_tags utility 2014-04-03 21:24:29 +02:00
Simon Charette 074d3183d9 Fixed #22363 -- Correctly serialize `django.utils.datetime_safe` objects.
Thanks to linovia for the report.
2014-04-03 14:54:16 -04:00
Tim Graham 0f6ea69e27 Cleaned up string detection for a deprecation warning by using six.string_types. 2014-04-03 11:03:31 -04:00
Vishal Lal a8e2ec0e82 Fixed #22372 -- Improved description of WizardView.get_context_data().
Thanks simon29 for the report.
2014-04-03 08:25:11 -04:00
Tim Graham d73d0e071c Fixed #22218 -- Deprecated django.conf.urls.patterns.
Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
2014-04-03 07:28:10 -04:00
Alex Gaynor 608e6eb295 Added an explanatory comment. Refs #22017 2014-04-02 09:47:18 -07:00
Alex Gaynor 666990a2a0 Revert "Merge pull request #2508 from tomwys/patch-1"
This reverts commit c45607e939, reversing
changes made to 9769337ca8.
2014-04-02 09:45:42 -07:00
Alex Gaynor 66cbd81456 Merge pull request #2509 from tomwys/patch-2
Refactor. Stop using memory for list copies.
2014-04-02 08:35:42 -07:00
Tomasz Wysocki cb9704fc4f Refactor. Stop using memory for list copies. 2014-04-02 17:32:51 +02:00
Tomasz Wysocki 6eb891f57a Don't copy list for iteration. 2014-04-02 17:28:09 +02:00
Daniel Neuhäuser 4aa80149e7 Fixed #22327 -- Turned BaseEmailBackend into a context manager
Changed the BaseEmailBackend to allow usage as context manager to open
and close connections.
2014-03-31 14:08:51 -04:00
Tim Graham 246face209 Fixed #22362 -- Improved AuthenticationMiddleware assertion message.
Thanks Keryn Knight.
2014-03-31 08:10:59 -04:00
Tim Graham 981b864fbd Replaced urllib/urlparse imports with from django.utils.six.moves. 2014-03-31 07:54:22 -04:00
Loic Bistuer 4339e9a92d Fixed #21795 -- Made add_preserved_filters account for url prefixes.
Thanks to trac username honyczek for the report. Refs #6903.
2014-03-31 07:19:59 -04:00
Tim Graham 029d77eaaa Fixed typo in docstring. 2014-03-31 07:01:13 -04:00
Loic Bistuer 0fd51cf0bd Fixed #22319 -- Fixed migration external dependencies when there are internal dependencies. 2014-03-31 06:50:38 -04:00
Loic Bistuer a449e7feec Fixed #22359 -- Changing M2M field to blank=True failed on sqlite. 2014-03-31 06:13:19 -04:00
Ramiro Morales 9a982d5ccc Moved ServerHandler helper class to tests.
It has been only used in the builtin_servers tests since Django 1.4.
2014-03-30 20:55:40 -03:00
Alex Gaynor 778ce245dd Corrected many style guide violations that the newest version of flake8 catches 2014-03-30 12:11:05 -07:00
Loic Bistuer 20399083f4 Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.
Since assignments on M2M or reverse FK descriptors is composed of a `clear()`,
followed by an `add()`, `clear()` could potentially affect the value of the
assigned queryset before the `add()` step; pre-evaluating it solves the problem.

This patch fixes the issue for ForeignRelatedObjectsDescriptor,
ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor.
It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
2014-03-30 15:36:45 +07:00
Loic Bistuer bc9be72bdc Fixed transaction handling for a number of operations on related objects.
Thanks Anssi and Aymeric for the reviews. Refs #21174.
2014-03-30 12:13:00 +07:00
Aymeric Augustin f356b6ecc3 Increased memoization cache size for language codes.
There may be more than 100 (default maxsize) commonly seen xx-yy values
on some sites. The additional memory consumption isn't significant.

Also added a comment explaining why this cache must have a maxsize.
2014-03-29 19:47:15 +01:00
Claude Paroz e819a3cd62 Skipped PostGIS version tests when psycopg2 not installed
Refs #22334. Thanks Tim Graham for spotting the issue.
2014-03-29 19:25:57 +01:00
Rémy Sanchez 88f1e3d93d Unit testing Postgis version check
Refs #22334.
2014-03-29 15:37:40 +01:00
Tim Graham ed4c2e1c0d Fixed #22329 -- Used label_tag() in some admin auth templates.
refs #17922.
2014-03-29 08:54:56 -04:00
Tim Graham 2cc8840397 Removed unused imports. 2014-03-29 08:54:30 -04:00
Claude Paroz 41903d025a Dropped support for GDAL 1.6 2014-03-29 11:08:52 +01:00
Claude Paroz c5d1df70a4 Dropped support for GEOS 3.1 2014-03-29 11:08:52 +01:00
Claude Paroz e62dea9ad5 Confirmed Spatialite 4 support 2014-03-29 11:08:52 +01:00
Claude Paroz 0f1f12c564 Confirmed GEOS 3.4 support 2014-03-29 11:08:52 +01:00
Anssi Kääriäinen 21f208e66e Fixed #22250 -- regression in gis compiler for non-concrete fields
Thanks to gwahl@fusionbox.com for the report.
2014-03-29 07:58:25 +02:00
Maxime Turcotte 5e4e0b6fe9 Fixed #22306 -- Deprecated future versions of cycle and firstof template tags. 2014-03-28 18:55:06 -04:00
Tim Graham 12e9adcd71 Corrected deprecation warnings. 2014-03-27 17:48:12 -04:00
Tim Graham dadf2ee75f Fixed a deprecation warning with the HTMLParser safe argument.
refs 6ca6c36f82
2014-03-27 09:17:49 -04:00
Chris Beaven b077ba7ac1 Add a useful stacklevel to some RemovedInDjango19Warnings 2014-03-27 15:44:52 +13:00
Claude Paroz d320863878 Fixed #22114 -- Stopped adding trailing slashes in URLField.to_python
Thanks coredumperror at gmail.com for the report and Tim Graham
for the review.
2014-03-26 18:10:58 +01:00
Simon Charette b9e50e4774 Fixed the PostGIS circular imports caused by 1506c71a95.
Thanks to @loic for the help and @timgraham for the review.

refs #12030.
2014-03-26 12:57:57 -04:00
Tim Graham 45ef4baf5c Fixed Python 3.4 test failure. 2014-03-26 09:57:00 -04:00
Zbigniew Siciarz 3cdb0baa45 Fixed #22335 -- Fixed popen_wrapper error on non-English Windows systems. 2014-03-26 00:42:19 +01:00
Simon Charette ff874f363c Fixed field deconstruction tests failures introduced by 1506c71a95.
refs #12030.
2014-03-25 18:54:52 -04:00
Tim Graham 42336c84a0 Fixed #22331 -- Made MigrationAutodetector ignore unmanaged models.
This commit reverts 69d4b1c and tackle the issue from a different angle.
Models remain present in the project state, but are now ignored by the
autodetector.
2014-03-25 18:30:58 -04:00
Simon Charette 1506c71a95 Fixed #12030 -- Validate integer field range at the model level.
Thanks to @timgraham for the review.
2014-03-25 14:31:20 -04:00
Tim Graham 9b7ba8af1b Fixed #22322 -- Fixed incorrect explanation of what managed=False does.
refs #14305.

Thanks Adrian Klaver for the report.
2014-03-25 14:01:37 -04:00
Loic Bistuer 69d4b1c3ea Fixed #22331 -- Fixed migrations ProjectState to ignore unmanaged models. 2014-03-25 10:33:44 -04:00
David Evans 86dcac4634 Fixed #22315 -- str/bytes mismatch in staticfiles
Previously, `ManifestFilesMixin.read_manifest` failed in Python 3
because `json.loads` accepts `str` not `bytes`.
2014-03-25 09:53:24 -04:00
Tim Graham e3c4205b79 flake8 and doc fixes for refs #22257. 2014-03-25 09:44:59 -04:00
Ben Davis 16afffffe8 Fixed #22087 -- Made AdminReadonlyField respect ModelForm Meta overrides. 2014-03-25 09:33:13 -04:00
Stephen Burrows 35ed792cf2 Fixed #22300 -- Fixed crash in migrations when changing non-relational field to relational. 2014-03-25 07:46:15 -04:00
Marc Tamlyn 09ab447d08 Merge pull request #2465 from coder9042/ticket_22258
Fixed #22257 -- Added file output option to dumpdata command.
2014-03-25 11:42:03 +00:00
Anubhav Joshi f34e8fc890 Fixed #22257 -- Added file output option to dumpdata command. 2014-03-25 13:47:03 +05:30
Daniel Hahler 1edfa155e3 Fixed #22293 -- Avoided renaming many-to-many tables to themselves.
Fixed this for both implementations of _alter_many_to_many, instead of
in `alter_db_table` itself (more implementations).
2014-03-24 13:24:52 -04:00
Jannis d81a9c50d8 Fixed typo in error message in django.contrib.sitemaps. 2014-03-24 13:06:06 -04:00
Anubhav Joshi 416a858023 Fixed #17922 -- Added required_css_class to form label.
Thanks hanson2010 for the suggestion.
2014-03-24 08:11:54 -04:00
Tim Graham 2ec82c7387 Updated six to 1.6.1. 2014-03-24 07:33:55 -04:00
Loic Bistuer 7ac8380799 Fixed #22318 -- Added Form.has_error() to easily check if a given error has happened. 2014-03-24 07:21:32 -04:00
Aymeric Augustin 58161e4e93 Fixed #22291 -- Avoided shadowing deadlock exceptions on MySQL.
Thanks err for the report.
2014-03-23 20:45:22 +01:00
Simon Charette a6fc18594e Fixed PostGIS test failures. 2014-03-22 18:12:52 -04:00
Simon Charette fa8b473528 Fixed #22299 -- Cleanup wizard temp files when possible.
Thanks to @erikr for the review.
2014-03-22 17:48:12 -04:00
Aymeric Augustin 232181d1c5 Advanced deprecation warnings for 1.8. 2014-03-22 21:12:58 +01:00
Claude Paroz 74b3467646 Removed GeoRSSSitemap
Refs #18531.
2014-03-22 19:58:50 +01:00
Ramiro Morales 491419b5ff Made m2m fields form help_text munging specific to admin widgets.
Refs #9321 and follow-up to e80de93af6.
2014-03-22 15:43:17 -03:00
Loic Bistuer e61d99d96d Fixed #20684 -- Added support for HTML5 boolean attributes to form widgets. 2014-03-22 14:28:12 -04:00
Alex Gaynor 684e8a941b Removed an unused variable. 2014-03-22 10:11:39 -07:00
Baptiste Mispelon 96fc3908ad Fixed a failing test introduced in 918a16bc4c.
Refs #22307.
2014-03-22 18:05:56 +01:00
Claude Paroz c94bff2b26 Fixed #22241 -- Selectively added line breaks in admin read-only fields
When content is supposed to contain HTML, we do not try to add
line breaks in read-only contents.
Thanks Alexander Todorov for the report.
2014-03-22 17:00:50 +01:00
Patrick Michaud acee46fc95 Fixed #22256 -- Replaced bad fallback for missing PATH
Thanks Baptiste Mispelon for the review.
2014-03-22 16:52:05 +01:00
Claude Paroz bc315266c8 Fixed #22294 -- Prevented converting length filter output to string
Thanks Steve Pike for the report.
2014-03-22 16:39:46 +01:00
Aymeric Augustin 6877a9d415 Avoided transactional truncates on amateur databases.
Fixed a test failure that appeared after 753a22a6, although the bug
existed before that commit.

Refs #22308.
2014-03-22 14:39:27 +01:00
Tim Graham ee4edb1eda Made ModelForms raise ImproperlyConfigured if the list of fields is not specified.
Also applies to modelform(set)_factory and generic model views.

refs #19733.
2014-03-22 07:56:48 -04:00
Aymeric Augustin 0757e0f30d Avoided transactional DDL on castrated databases.
Fixed a test failure that appeared after 753a22a6, although the bug
existed before that commit.

Refs #22308.
2014-03-22 11:05:14 +01:00
Claude Paroz 6ca6c36f82 Improved strip_tags and clarified documentation
The fact that strip_tags cannot guarantee to really strip all
non-safe HTML content was not clear enough. Also see:
https://www.djangoproject.com/weblog/2014/mar/22/strip-tags-advisory/
2014-03-22 10:59:18 +01:00