Commit Graph

9744 Commits

Author SHA1 Message Date
Simon Charette f5f662fa5f Fixed #21112 -- Make sure sitemaps with no lastmod date work correctly.
Thanks to Matthias Kestenholz for the report and patch.
2013-09-17 10:21:11 -04:00
Anssi Kääriäinen 9400142132 Fixed #21109 -- made db cursor error wrapping faster 2013-09-17 12:18:55 +03:00
Tim Graham f40c82213f Added backwards compatability shims for util modules.
refs #17627
2013-09-16 12:53:42 -04:00
Tim Graham 18ffdb1772 Fixed #17627 -- Renamed util.py files to utils.py
Thanks PaulM for the suggestion and Luke Granger-Brown and
Wiktor Kołodziej for the initial patch.
2013-09-16 12:52:05 -04:00
Russell Keith-Magee aae5a96d57 Ensure that passwords are never long enough for a DoS.
* Limit the password length to 4096 bytes
  * Password hashers will raise a ValueError
  * django.contrib.auth forms will fail validation
* Document in release notes that this is a backwards incompatible change

Thanks to Josh Wright for the report, and Donald Stufft for the patch.

This is a security fix; disclosure to follow shortly.
2013-09-15 13:42:23 +08:00
Florian Apolloner 2fa0dd73b1 Fixed error handling in 3c5775d36f for non-operational webdrivers. 2013-09-14 23:24:48 +02:00
Florian Apolloner 3c5775d36f Delayed initialization of Selenium webdrivers.
If setUpClass throws an exception (in this case "Address already in use" if the
super call can't find any open port to bind too) tearDownClass is not called.
This results in open browser windows from the webdriver, hence we only construct
it once we are sure there is no code afterwards which could error out.
2013-09-14 22:58:30 +02:00
Alex Gaynor bac86ad1a3 REmoved some unused imports 2013-09-14 12:34:57 -07:00
Alex Gaynor 5c645ec81a Merge branch 'master' of https://github.com/django/django 2013-09-14 12:32:45 -07:00
Alex Gaynor 496b4d0331 Removed an import * that was masking importing stuff from the wrong location 2013-09-14 12:32:25 -07:00
Anssi Kääriäinen ff723d894d Fixed #20950 -- Instantiate OrderedDict() only when needed
The use of OrderedDict (even an empty one) was surprisingly slow. By
initializing OrderedDict only when needed it is possible to save
non-trivial amount of computing time (Model.save() is around 30% faster
for example).

This commit targetted sql.Query only, there are likely other places
which could use similar optimizations.
2013-09-14 20:52:17 +03:00
Tim Graham 886bb9d878 Revert "Fixed #12288 -- Validated that app names in INSTALLED_APPS are unique"
This reverts commit c1ec08998d.

There are backwards compatability concerns with this.
2013-09-14 07:19:32 -04:00
Michael Manfre c89d80e2cc Fixed #21097 - Added DatabaseFeature.can_introspect_autofield 2013-09-14 09:48:59 +03:00
Juan Catalano 6feb75129f Fixed #21060 -- Refactored admin's autodiscover method to make it reusable.
We want to be able to use it for instance for discovering `tasks.py` modules
inside the INSTALLED_APPS.

This commit therefore moves the logic to `autodiscover_modules` method in
django.utils.module_loading.
2013-09-13 20:09:41 -04:00
e0ne c1ec08998d Fixed #12288 -- Validated that app names in INSTALLED_APPS are unique 2013-09-13 08:09:21 -04:00
Daniel Sokolowski ad6fcdb8d2 Fixed #20844 -- Made AdminEmailHandler respect LOGGING 'formatter' setting. 2013-09-13 07:27:54 -04:00
Claude Paroz 4c5641dd92 Fixed inspectdb test for spatialite >=4 2013-09-12 11:14:16 +02:00
Claude Paroz c82f6c2227 Add a test for the geo-enabled inspectdb command 2013-09-12 10:30:45 +02:00
Michael Manfre e61cc87129 Fixed #21090 -- Allowed backends to provide dotted field path to inspectdb. 2013-09-11 13:35:26 -04:00
Baptiste Mispelon abb10db06f Fixed #21089 -- Allow TransactionTestcase subclasses to define an empty list of fixtures.
Thanks to lgs for the report and initial patch.
2013-09-11 15:28:04 +02:00
Keryn Knight 170f721367 Fixed #21056 -- AdminSite.app_index no longer blindly accepts any app-labelish input. 2013-09-11 08:48:32 -04:00
Tim Graham 7fe5b656c9 Prevented arbitrary file inclusion with {% ssi %} tag and relative paths.
Thanks Rainer Koirikivi for the report and draft patch.

This is a security fix; disclosure to follow shortly.
2013-09-10 21:02:48 -04:00
Tim Graham 8165c2cfd1 Improved deprecation warning for change in form boolean values.
refs #20684

Thanks jacob, jcd, and shai for the suggestions.
2013-09-10 14:24:34 -04:00
Tim Graham 4e96dac450 Fixed #19298 -- Added MultiValueField.__deepcopy__
Thanks nick.phillips at otago.ac.nz for the report.
2013-09-10 13:56:49 -04:00
e0ne 053de6131a Fixed #5749 -- Added field_name as a key in the _html_output dict
Thanks SmileyChris for the suggestion.
2013-09-10 13:00:10 -04:00
Juan Catalano 4840fd9cbc Fixed #20919 -- Extended assertRedirects to be able to avoid fetching redirect's response.
Thanks mjtamlyn for the suggestion.
2013-09-10 12:22:55 -04:00
Gregor MacGregor b2b763448f Fixed #20841 -- Added messages to NotImplementedErrors
Thanks joseph at vertstudios.com for the suggestion.
2013-09-10 11:09:59 -04:00
Loic Bistuer d59f1993f1 Made MigrationWriter look for a "deconstruct" attribute on functions.
Refs #20978.
2013-09-10 10:12:23 -04:00
Loic Bistuer 5df8f749e6 Fixed #20978 -- Made deletion.SET_NULL more friendly for MigrationWriter.serialize. 2013-09-10 10:12:23 -04:00
Tim Graham 4ba373840a Fixed #16534 -- Improved ability to customize DiscoverRunner
Added DiscoverRunner.test_suite and .test_runner attributes.

Thanks tomchristie for the suggestion and jcd for the patch.
2013-09-10 09:49:39 -04:00
Roberto Aguilar af67ce5e18 Fixed #4574 -- Added CSS classes to the admin calendar widget for better control over styling. 2013-09-10 08:07:17 -05:00
Tim Graham 2bc5143866 Fixed #7467 -- Added a template block to override the admin welcome message.
Thanks Jeff Kowalczyk for the suggestion and rctay for the patch.
2013-09-10 08:48:03 -04:00
John Hensley 30fc49a7ca Fixed #21057 -- Prevented FileSystemStorage from leaving temporary files. 2013-09-10 08:33:53 -04:00
e0ne f2a4452882 Fixed #18403 -- Initialized bad_cookies in SimpleCookie
Thanks Stefano Crosta for the report.
2013-09-10 08:26:54 -04:00
homm 7008ed61c5 Fixed #21033 -- Fixed uploaded filenames not always being truncated to 255 characters 2013-09-10 01:55:16 +02:00
Aymeric Augustin d9413d33b2 Refactored code and tests that relied on django.utils.tzinfo.
Refs #17262.
2013-09-09 22:32:52 +02:00
Aymeric Augustin ec2778b445 Fixed #17262 -- Refactored tzinfo implementations.
This commit deprecates django.utils.tzinfo in favor of the more recent
django.utils.timezone which was introduced when Django gained support
for time zones.
2013-09-09 22:32:51 +02:00
Kevin Christopher Henry 9d700322b3 Fixed #19885 -- cleaned up the django.test namespace
* override_settings may now be imported from django.test
* removed Approximate from django.test
* updated documentation for things importable from django.test

Thanks akaariai for the suggestion.
2013-09-09 16:03:13 -04:00
Josh Mize a52cc1c088 Fixed #21078 -- Handled additional bad Accept-Language header 2013-09-09 15:19:09 -04:00
Keryn Knight 0d74f9553c Fixed #21063 -- AdminSite app_index should be fail early if the user has no permissions. 2013-09-09 12:51:03 -04:00
Садовский Николай 1185370c2c Fixed #20707 -- Added explicit quota assignment to Oracle test user
To enable testing on Oracle 12c
2013-09-09 16:25:13 +03:00
Curtis Maloney 7c6f2ddcd9 Simplify FilterExpression.args_check 2013-09-09 09:03:50 -04:00
Daniel Boeve 6dca603abb Fixed #20889 -- Prevented email.Header from inserting newlines
Passed large maxlinelen to email.Header to prevent newlines from being
inserted into value returned by _convert_to_charset

Thanks mjl at laubach.at for the report.
2013-09-09 08:47:41 -04:00
Baptiste Mispelon 28a571348b Fix #20745: Don't silence TypeError raised inside templates.
Thanks to robin for the report and claudep for the review.
2013-09-08 22:05:35 +02:00
Alex Gaynor 9d11522599 Removed some more unused local vars 2013-09-08 12:20:01 -07:00
Alex Gaynor 96fd5557f9 Removed a ton of unused local vars 2013-09-08 08:05:16 -07:00
Alex Gaynor 0ee8aa5c39 Removed an unused local var 2013-09-08 07:42:16 -07:00
Aymeric Augustin ded11aa620 Fixed #18766 -- Pointed to pytz when LocalTimezone fails.
Thanks void for the report.
2013-09-08 02:04:43 -05:00
Pablo Mouzo b11564fd36 Fixed #16869 -- BaseGenericInlineFormSet.save_new should use form's save() method
Thanks mattaustin for the report and Pablo Recio (pyriku) for the patch.
2013-09-07 20:00:38 -04:00
Juan Catalano 04415bf81b Fixed #21013 -- Ensure that ModelAdmin.get_queryset is considered for the admin history view. 2013-09-07 14:53:29 -05:00
Aymeric Augustin 31e16c1343 Negligible style fix. 2013-09-07 13:48:37 -05:00
Alex Gaynor 907f19eba7 Merge pull request #1565 from garrypolley/#19988-ordinal-html-i18n-fix
fixes #19988, allow html in ordinal for humanize
2013-09-07 11:13:55 -07:00
Julien Phalip 55a11683f7 Fixed #20836 -- Ensure that the ForeignKey's to_field attribute is properly considered by the admin's interface when creating related objects.
Many thanks to Collin Anderson for the report and patch and to Peter Sheats for the test.
2013-09-07 12:14:07 -05:00
Aymeric Augustin 476b07641c Oops :( 2013-09-07 11:32:39 -05:00
Aymeric Augustin 7bb6279360 Fixed an encoding issue in the test client.
Fixed
comment_tests.tests.test_comment_view.CommentViewTests.testCommentPostRedirectWithInvalidIntegerPK.

Refs #20530.
2013-09-07 11:31:08 -05:00
Andrew Godwin bacbbb481d RunSQL migration operation and alpha SeparateDatabaseAndState op'n. 2013-09-07 11:03:38 -05:00
Pablo Mouzo 73de9dd1fa Add `response_delete` and `render_delete_form` methods to `ModelAdmin`
This make it easier to control the delete flow.
2013-09-07 10:59:49 -05:00
Aymeric Augustin 8aaca651cf Fixed #20557 -- Properly decoded non-ASCII cookies on Python 3.
Thanks mitsuhiko for the report.

Non-ASCII values are supported. Non-ASCII keys still aren't, because the
current parser mangles them. That's another bug.
2013-09-07 10:25:43 -05:00
Aymeric Augustin ae7f9afaf6 Minor cleanup in the WSGI handler. 2013-09-07 10:25:16 -05:00
Aymeric Augustin 4e88d106dc Refactored the unmangling of the WSGI environ. 2013-09-07 10:03:50 -05:00
Aymeric Augustin 636860fbfb Moved two WSGI-specific functions to the WSGI handler.
They were defined in base when the mod_python handler used them. See bfcecbff.
2013-09-07 10:03:49 -05:00
Loic Bistuer ec47de77d6 Fixed regression introduced by a962286, changed ugettext to ugettext_lazy. 2013-09-07 08:09:13 -04:00
Alex Gaynor 2530735d2d Fixed a number of flake8 errors -- particularly around unused imports and local variables 2013-09-06 21:56:40 -07:00
Loic Bistuer 37d46b20fc Fixed regression introduced by efd1e60, 'map' returns an iterator on PY3. 2013-09-07 08:00:11 +07:00
Eric Boersma ded40142a9 Fixed #20007 -- Configured psycopg2 to return UnicodeArrays
Thanks hogbait for the report.
2013-09-06 20:43:58 -04:00
Russell Keith-Magee 926bc421d9 Merge pull request #1566 from adamsc64/ticket_11857
Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.
2013-09-06 17:38:37 -07:00
Loic Bistuer adc0ab3386 Fixed #21037 -- Made MigrationWriter raise a ValueError when serializing lambda functions. 2013-09-06 20:13:01 -04:00
Tim Graham 498014ccd5 Fixed Python 3 syntax error introduced in [c72392da] 2013-09-06 20:07:57 -04:00
Russell Keith-Magee 4f5faa1916 Merge pull request #1582 from rca/12756-missing-yaml-module-serializer-error-message
Fixed #12756: Improved error message when yaml module is missing.
2013-09-06 16:05:02 -07:00
Roberto Aguilar 01a5359477 Cleanup commit after peer review. 2013-09-06 22:45:31 +00:00
Russell Keith-Magee 9b2dc12b83 Merge pull request #1580 from ianawilson/ticket_16502
Fixed #16502 -- Fixed a TemplateDoesNotExist error that should be an ImproperlyConfigured.

Assistance on the patch from #jambronrose.
2013-09-06 15:31:25 -07:00
Aymeric Augustin b4cd8169de Fixed #11811 -- Data-loss bug in queryset.update.
It's now forbidden to call queryset.update(field=instance) when instance
hasn't been saved to the database ie. instance.pk is None.
2013-09-06 17:15:23 -05:00
Aymeric Augustin 73f38eb4d1 Minor factorization. 2013-09-06 17:15:23 -05:00
Russell Keith-Magee 122020fdb9 Merge pull request #1579 from ianawilson/ticket_21058
Fixed #21058 -- Fixed debug view blowing up when no template is provided to the template rendering functions.

Assistance on this commit from @jambonrose.
2013-09-06 15:06:57 -07:00
Adrian Holovaty e844e10b4f Moved a settings usage up the stack in utils/formats.py #unsettings 2013-09-06 17:01:36 -05:00
Andrew Godwin 0b7cf56e28 Add -l alias for migrate --list 2013-09-06 17:00:38 -05:00
Ian Wilson b79df0b358 adds fix for SingleObjectTemplateResponseMixin raising a TemplateDoesNotExist when it should have raised an ImproperlyConfigured. fixes 16502. by @ianawilson, @jambonrose 2013-09-06 16:27:34 -05:00
Julien Phalip d5df914fe1 Merge pull request #1578 from rmutter/ticket_20821
Fixed #20821 -- Added tooltips to Admin SelectBox widget
2013-09-06 14:03:58 -07:00
Ian Wilson 9b7f4aab32 adds fix and test for when a template is not specified at all to render(). fixes #21058. by jambonrose and ianawilson 2013-09-06 15:50:18 -05:00
Rudy Mutter c438cc2a36 Fixed #20821 -- Added tooltips to Admin SelectBox widget
The Admin widget, which can be used to filter multiple selects
can sometimes be too narrow and hide information such as
user permissions. This commit adds tooltips to the select
options so that a user can hover over and see the hidden text.
2013-09-06 15:46:38 -05:00
Andrew Godwin ce5e09353d Merge pull request #1575 from mburst/ticket_21049
Fixed #21049 -- Fixed autoreload for Python 3
2013-09-06 13:37:11 -07:00
Roberto Aguilar 076cf131ec Moved get_serializer() call in dumpdata command.
Moved the get_serializer() call within the condition that checks public
serializers.  This will allow exceptions other than
SerializerDoesNotExist to be raised in order to provide the caller with
useful information, e.g when pyyaml is not installed.
2013-09-06 20:33:23 +00:00
Roberto Aguilar c72392dab4 Added yaml directly into BUILTIN_SERIALIZERS.
The serializer definitely exists, but the dependent yaml module may not
be installed.  The register_serializer() function will catch exceptions
and will stub in a fake serializer object that will raise the exception
when the serializer is used.
2013-09-06 20:33:23 +00:00
Andrew Godwin efd1e6096e Adding 'sqlmigrate' command and quote_parameter to support it. 2013-09-06 15:28:12 -05:00
Dan Johnson df462cf760 Fixed #21043 -- Made resolve() handle reverse_lazy objects.
Thanks Keryn Knight for the report.
2013-09-06 15:46:43 -04:00
Max Burstein 559cb826b8 Fixed #21049 -- Fixed autoreload for Python 3
Changed th system module values check to return a list.
In Python 3 it returns a dict_view which could occassionally produce
a runtime error of "dictionary changed size during iteration".
2013-09-06 14:37:43 -05:00
Florian Apolloner 85359ec9a4 Merge branch 't20812' 2013-09-06 21:03:46 +02:00
Daniel Langer cc957cb16c Fixed #4287 -- Fixed NaN and +/- Infinity handling in FloatField
NaN, +Inf, and -Inf are no longer valid values for FloatFields.
2013-09-06 14:56:37 -04:00
Christopher Adams b2f5ac1656 Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.
- TemporaryFile now minimally mocks the API of the Python standard
  library class tempfile.NamedTemporaryFile to avoid AttributeError
  exceptions.
- The symbol django.core.files.NamedTemporaryFile is actually assigned
  as a different class on different operating systems.
- The bug only occurred if Django is running on Windows, hence why it
  was hard to diagnose.
2013-09-06 14:32:46 -04:00
Garry Polley 337bd248a5 fixes #19988, allow html in ordinal for humanize 2013-09-06 12:59:44 -05:00
Andrew Godwin 05e14e8eaf Migration autodetector now corerctly deals with proxy models 2013-09-06 12:39:46 -05:00
Adrian Holovaty a962286b74 Added AdminSite attributes for easily changing admin title.
AdminSite now has overridable site_header, site_title and index_title attributes. Changed
each admin view to pass these to the context (in a new AdminSite.each_context() method).
The intent here is to make it easier to override these things in the common case, instead of
having to override a template, which is a bigger burden.
2013-09-06 12:31:50 -05:00
Adrian Holovaty 273a1e6b8d Fixed awkward indentation in admin URLconfs 2013-09-06 12:31:50 -05:00
Florian Apolloner 2326dedde8 Fixed #20812 -- Error out if __unicode__/__str__ doesn't return a text type. 2013-09-06 19:24:18 +02:00
Andrew Godwin cdeff3acc2 Project/ModelState now correctly serialize multi-model inheritance 2013-09-06 12:16:03 -05:00
Chris Wilson eade315da1 Fixed #10164 -- Made AutoField increase monotonically on SQLite
Thanks malte for the report.
2013-09-06 12:31:17 -04:00
Andrew Godwin 630eb0564a Fix SchemaEditor.__exit__ to handle exceptions correctly 2013-09-06 11:09:16 -05:00
Andrew Godwin 9f6e6009a4 Add --list option to migrate command 2013-09-06 11:06:19 -05:00
Andrew Godwin 32838a5beb Make db.migrations ignore South-style migrations. 2013-09-06 10:35:53 -05:00
Aymeric Augustin b80be68e08 Fixed #21052 -- Small performance optimization. 2013-09-06 10:34:32 -05:00