Commit Graph

6751 Commits

Author SHA1 Message Date
Aymeric Augustin da2c6959c8 Dropped the needs_datetime_string_cast feature.
It has been superseded by the converter infrastructure.
2015-05-17 10:23:13 +02:00
Aymeric Augustin 2a05a82311 Worked around a bug when chaining skipIf/UnlessDBFeature. 2015-05-17 09:40:33 +02:00
Aymeric Augustin ed83881e64 Fixed #23820 -- Supported per-database time zone.
The primary use case is to interact with a third-party database (not
primarily managed by Django) that doesn't support time zones and where
datetimes are stored in local time when USE_TZ is True.

Configuring a PostgreSQL database with the TIME_ZONE option while USE_TZ
is False used to result in silent data corruption. Now this is an error.
2015-05-17 09:40:28 +02:00
Aymeric Augustin 54026f1e8d Renamed value_to_db_xxx to adapt_xxxfield_value.
This mirrors convert_xxxfield_value nicely, taking advantage of the
adapter/converter terminology which is commonly used by DB-API modules.
2015-05-17 09:39:34 +02:00
Aymeric Augustin d9521f66b1 Removed global timezone-aware datetime adapters.
Refs #23820.

Fixed #19738.

Refs #17755. In order not to introduce a regression for raw queries,
parameters are passed through the connection.ops.value_to_db_* methods,
depending on their type.
2015-05-17 09:38:48 +02:00
Aymeric Augustin ec186572e6 Removed global timezone-aware datetime converters.
Refs #23820.
2015-05-17 09:36:23 +02:00
Tim Graham eda12ceef1 Removed redundant list() calls. 2015-05-16 10:44:07 -04:00
Piotr Jakimiak 70e3e2e08e Fixed #24774 -- Made contrib.site's Site.domain field unique 2015-05-16 08:43:42 -04:00
Claude Paroz 3226050358 Fixed #24791 -- Added fallback when 'postgres' database isn't available
Thanks Carl Meyer and Tim Graham for the reviews.
2015-05-15 18:44:20 +02:00
Bo Lopker 2dee853ed4 Fixed #24799 -- Fixed session cookie deletion when using SESSION_COOKIE_DOMAIN 2015-05-15 11:23:41 -04:00
Claude Paroz ae635cc365 Fixed #24757 -- Recreated MySQL index when needed during combined index removal
Thanks Thomas Recouvreux for the report and Tim Graham for the tests and
review.
2015-05-15 17:07:14 +02:00
Riccardo Magliocchetti adf5d75af1 Refs #24553 -- Isolated admin_* tests.
This fixes a regression with runtests.py --reverse after
bd53db5eab

We need to avoid leaking model registration in the default AdminSite.
2015-05-14 09:57:13 -04:00
Claude Paroz f61c4f490d Fixed #24742 -- Made runserver.check_migrations ignore read-only databases
Thanks Luis Del Giudice for the report, and Aymeric Augustin and Markus
Holtermann for the reviews.
2015-05-13 18:30:36 +02:00
Tim Graham 3c8fe5dddf Fixed #24751 -- Fixed HStoreField isnull lookup. 2015-05-13 10:31:59 -04:00
Claude Paroz e60eccd62e Removed test numbering in gdal tests 2015-05-13 14:13:20 +02:00
Abhaya Agarwal 9de9c24017 Fixed #24105 -- Called Storage.get_valid_name() when upload_to is callable 2015-05-12 20:08:22 -04:00
Abhaya Agarwal 7c7b855106 [1.8.x] Refs #24698, #24712 -- Forwardported ForeignKey.get_db_prep_value() test and release notes.
Fixed in master by b68212f539.

Forwardport of 290c9d6654 from stable/1.8.x
2015-05-12 19:42:42 -04:00
Andriy Sokolovskiy f7b2978158 Fixed #24156 -- Fixed inherited related name of ManyToManyField.
Fixed situation when parent abstract model declares related_name='+',
and child models had an invalid queryset.
2015-05-12 19:14:55 -04:00
Claude Paroz 70779d9c1c Fixed #24733 -- Passed the triggering exception to 40x error handlers
Thanks Tim Graham for the review.
2015-05-11 22:02:14 +02:00
Riccardo Magliocchetti bd53db5eab Fixed #24553 -- Added the list of available applications to AdminSite.each_context() 2015-05-11 12:07:36 -04:00
Anssi Kääriäinen adc57632bc Fixed #24748 -- Fixed incorrect GROUP BY on MySQL in some queries
When the query's model had a self-referential foreign key, the
compiler.get_group_by() code incorrectly used the self-referential
foreign key's column (for example parent_id) as GROUP BY clause
when it should have used the model's primary key column (id).
2015-05-11 11:42:27 -04:00
Anssi Kääriäinen be9d645346 Fixed #24766 -- Added join promotion for Case expressions 2015-05-11 11:16:16 -04:00
Tim Graham 3074c5b19e Fixed typo in settings_tests 2015-05-09 18:23:57 -04:00
Claude Paroz 67c063e6d5 Mocked db.connections in test_runner tests 2015-05-09 17:04:06 +02:00
Preston Timmons d17a035132 Moved engine-related exceptions to django.template.exceptions.
With the introduction of multiple template engines these exceptions are no
longer DTL-specific. It makes more sense for them to be moved out of
DTL-related modules.
2015-05-06 17:33:47 -05:00
Preston Timmons adff499e47 Fixed #24119, #24120 -- Formalized debug integration for template backends. 2015-05-06 17:33:47 -05:00
Claude Paroz d1df1fd2bb Fixed #24207 -- Added 25D-type geometry field support to ogrinspect
Thanks Michael Diener for the report and sample data, and Tim Graham
for the review.
2015-05-06 20:31:36 +02:00
Samuel Paccoud d084176cc1 Fixed #16609 -- Fixed duplicate admin results when searching nested M2M relations.
This was fixed earlier but only when the M2M relation was at the first
level on the object. This commit fixes the issue even when the M2M is
at deeper levels, such as behind a foreign key.
2015-05-06 09:56:12 -04:00
wdmgsm 4dcc649341 Fixed #24497 -- Added Widget.supports_microseconds attribute 2015-05-06 07:13:00 -04:00
Pradeek 6123e6134f Fixed #24708 -- Handled non-string values in GenericIPAddressField.to_python() 2015-05-06 07:03:31 -04:00
Claude Paroz e7e39d32fd Made some tests run on non-GIS databases 2015-05-05 20:28:28 +02:00
Anssi Kääriäinen 7b05d2fdae Fixed #24752 -- query crash when reusing Case expressions
Case expressions weren't copied deep enough (self.cases list was
reused resulting in an error).
2015-05-05 11:38:12 -04:00
Antonio Garcia-Dominguez 5c412dd8a7 Fixes #24727 -- Prevented ClearableFileInput from masking exceptions on Python 2 2015-05-04 09:44:18 -04:00
Aymeric Augustin 1563b897c4 Fixed #24685 -- Fixed check for template name unicity.
Thanks Preston Timmons for the report.
2015-05-03 21:49:16 +02:00
Jay Cox eef95ea96f Fixed #24696 -- Made CSRF_COOKIE computation lazy.
Only compute the CSRF_COOKIE when it is actually used. This is a
significant speedup for clients not using cookies.

Changed result of the “test_token_node_no_csrf_cookie” test:  It gets
a valid CSRF token now which seems like the correct behavior.

Changed auth_tests.test_views.LoginTest.test_login_csrf_rotate to
use get_token() to trigger CSRF cookie inclusion instead of changing
request.META["CSRF_COOKIE_USED"] directly.
2015-05-02 19:45:14 -04:00
Adam Zapletal 0894643e40 Fixed #23387 -- Kept "Save as new" button after validation errors in admin.
When "Save as new" is chosen and errors occur, only show the "Save as new"
button and not the other save buttons.

Thanks to Tino de Bruijn for doing the real work on this fix.
2015-05-02 19:41:10 -04:00
Luis Del Giudice 69ddc1b3da Fixed #24693 -- Added label and label_lower property to Model._meta 2015-05-02 16:58:18 +02:00
Markus Holtermann 811d7870a5 Moved migration exception classes to shared module
Thanks Aymeric Augustin for the review.
2015-05-02 12:54:44 +02:00
Tim Graham 29e90f3ae0 Fixed model_regress test failure on non-ASCII path; refs #24717. 2015-04-30 07:48:21 -04:00
Markus Holtermann 63f9b633f9 Fixed #24725 -- Allowed renaming of target models in ManyToMany relations
This is a regression caused by introducing rendered migration states in
1aa3e09c20 and the _meta refactoring in fb48eb0581.

Thanks to Danilo Bargen for reporting the issue and Marten Kenbeek and
Tim Graham for triaging the bug and providing the initial test case.
2015-04-30 13:27:29 +02:00
David D. Riddle 31e6c9c8e3 Fixed #24717 -- Fixed model_regress test failure on RHEL6 SCL
The test failed on RHEL6 systems running python 2.7 from a RedHat
Software Collection (SCL) because this test runs an external python
script with a stripped system environment. RedHat SCLs work by setting
a number of system environment variables when these are stripped out by
this test the python 2.7 interpreter is no longer able to function
properly because it can not find the system libraries needed.

Now we use use mock to modify the system environment directly.
2015-04-29 12:28:24 -04:00
Markus Bertheau 4a438e400b Fixed #13008 -- Added more Cache-Control headers to never_cache() decorator. 2015-04-28 12:07:02 -04:00
Aric Coady 9c2d8cde77 Fixed #24719 -- Restored the ability to use interators as queryset related object filters. 2015-04-28 10:51:27 -04:00
Alasdair Nicol eaeea6f947 Fixed #24714 -- Used more specific assertions than assertEqual in tests. 2015-04-28 09:31:04 -04:00
Tim Graham 3b133ffb8b Fixed template_tests failure on Windows. 2015-04-28 07:55:27 -04:00
Alasdair Nicol d91321e8be Used assertIsInstance in tests. 2015-04-27 08:40:36 -04:00
Harry 40768ec29d Fixed #24707 -- Improved error reporting for explicitly imported uncallable views 2015-04-26 19:19:15 +02:00
Artis Avotins 86aaffa5a3 Fixed #24689 -- Fixed DetailView methods with deferred QuerySet. 2015-04-25 19:42:00 -04:00
Tim Graham 2d76b61dc2 Fixed #24649 -- Allowed using Avg aggregate on non-numeric field types. 2015-04-25 13:06:14 -04:00
Tim Graham 26996e2d55 Fixed #24499 -- Dropped support for PostGIS 1.5. 2015-04-25 12:21:16 -04:00