Commit Graph

3492 Commits

Author SHA1 Message Date
Alex Gaynor 7548aa8ffd More attacking E302 violators 2013-11-02 13:12:09 -07:00
Boryslav Larin e737c009b8 Fixed flake8 E241 2013-11-02 21:45:40 +02:00
Tim Graham 36ded01527 Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
Alex Gaynor 19256f300e Continue to attack E302 violations 2013-11-02 10:18:46 -07:00
Claude Paroz c64efe3734 Fixed #15529 -- More permissive geojson syntax in constructor
Thanks Wouter Klein Heerenbrink for the report.
2013-10-31 18:15:54 +01:00
Alex Gaynor 726ded5708 Started attackign the next flake8 violation 2013-10-31 08:42:28 -07:00
Baptiste Mispelon 9fde42a69a Fixed #20610: Added a message level dict to contrib.message context processor. 2013-10-30 13:54:07 +01:00
Unai Zalakain fd219fa24c Fixed #8261 -- ModelAdmin hook for customising the "show on site" button
``ModelAdmin.view_on_site`` defines wether to show a link to the object on the
admin detail page. If ``True``, cleverness (i.e. ``Model.get_absolute_url``) is
used to get the url. If it's a callable, the callable is called with the object
as the only parameter. If ``False``, not link is displayed.

With the aim of maitaining backwards compatibility, ``True`` is the default.
2013-10-29 17:10:12 -04:00
Alex Gaynor b9a90b371c Remove dsome import * 2013-10-26 20:57:08 -07:00
Alex Gaynor b35ff0d920 Fixed all the E203 violations 2013-10-26 18:27:42 -07:00
Alex Gaynor f2d8027c9a Fixed up some more flake8 violations (this particular violation still has many occurrences in the tests/ dir so it can't be removed from setup.cfg yet) 2013-10-26 10:50:40 -07:00
Kevin Christopher Henry 08c9ab5a0f Fixed #21227 -- Added workaround for selenium test failures
Added a refresh() before quit() in the selenium tests, since this
solves the problem of spurious test failures in some environments.
2013-10-24 15:07:41 -04:00
Renato Oliveira 43569647ab Fixed #21299 - Changed filters from title to capfirst on admin inline formsets.
Previously there was a mixture of the two which resulted in inconsistent
casing.
2013-10-24 14:44:07 -04:00
Alex Gaynor 9bf5610890 Start attacking E231 violations 2013-10-24 10:30:03 -07:00
Alasdair Nicol c3aa2948c6 Fixed #21298 -- Fixed E301 pep8 warnings 2013-10-23 13:45:03 +01:00
Tim Graham ae48d77ef8 Fixed E225 pep8 warnings. 2013-10-23 06:09:29 -04:00
Ramiro Morales 51d2e1fb23 Fixed #21307 -- Moved TransRealMixin to django.test.utils. 2013-10-22 22:19:56 -03:00
Tim Graham 1597503a01 Fixed E221 pep8 warnings. 2013-10-22 09:51:39 -04:00
Tim Graham 8e2029f8dd Removed import * in tests.
Thanks to flake8 path/to/file.py | awk -F ' ' '{ print $5 }' | sort | uniq
2013-10-22 08:32:01 -04:00
Loic Bistuer e565e1332d Fixed #21275 -- Fixed a serializer error when generating migrations for contrib.auth.
The migration serializer now looks for a deconstruct method on any object.
2013-10-21 14:54:52 -04:00
Florian Apolloner 7d0d0dbf26 Force update of the password on iteration count changes. 2013-10-21 20:31:28 +02:00
Alasdair Nicol b289fcf1bf Fixed #21288 -- Fixed E126 pep8 warnings 2013-10-21 08:31:30 -04:00
Claude Paroz 5f52590368 Fixed #21291 -- Ensured inactive users cannot reset their passwords
Thanks kz26 for the report and the suggested fix. Refs #19758.
2013-10-19 10:43:06 +02:00
Claude Paroz 59a8808632 Cleaned formatting/comments in PasswordResetFormTest 2013-10-19 10:43:06 +02:00
Tim Graham ac4fec5ca2 Fixed bug causing CSRF token not to rotate on login.
Thanks Gavin McQuillan for the report.
2013-10-18 08:31:19 -04:00
Alasdair Nicol a800036981 Fixed #21287 -- Fixed E123 pep8 warnings 2013-10-18 10:07:39 +01:00
Alasdair Nicol bab9123daa Fixed #21268 -- Fixed E303 pep8 warnings 2013-10-18 01:46:24 +01:00
Alasdair Nicol 65d1d65d52 Fixed #21267 -- Fixed E502 pep8 warnings 2013-10-18 01:28:32 +01:00
Alasdair Nicol dfb4cb9970 Fixed #21285 -- Fixed E121,E122 pep8 warnings 2013-10-17 20:20:11 -04:00
Kathryn Killebrew 7e5d7a76bf Fixed #21259 -- Fixed formstools wizard for InlineFormSet. 2013-10-17 14:01:02 -04:00
Tim Graham 9833b931b7 Removed importing formtools tests in __init__.py
Unnecessary since introduction of DiscoveryTestRunner in 9012833af8.
2013-10-17 13:51:36 -04:00
Bouke Haarsma 2fb5a51fa3 Fixed #18659 -- Deprecated request.REQUEST and MergeDict
Thanks Aymeric Augustin for the suggestion.
2013-10-17 09:42:28 -04:00
Alex Gaynor 98788d3c3a Remove some unnecesary uses of bool 2013-10-17 05:27:34 -07:00
Alex Gaynor 7f508a3673 Removed some dead code and simplified some other ocde 2013-10-17 05:15:08 -07:00
Alasdair Nicol eb214452c3 Fixed #21270 -- Fixed E701 pep8 warnings 2013-10-17 12:12:40 +01:00
Tim Graham 91c77eeab8 Avoided hardcoding Permission.name max_length
refs #18866.
2013-10-16 11:31:07 -04:00
Bouke Haarsma 3918eeb9fd Fixed #7551 -- Made GFK allow None init argument.
Thanks SamBull for the report.
2013-10-16 07:03:46 -04:00
Ryan Allen f719d4afc7 Updated admin alert colors
refs #21220.
2013-10-15 10:18:51 -04:00
Unai Zalakain c7634cd7fe Fixed #7603 -- Added a 'scheme' property to the HttpRequest object
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is
appropriately set and falls back to `HttpRequest._get_scheme()` (a hook
for subclasses to implement) otherwise.

`WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI
environ variable to determine the request scheme.

`HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is
`https`.

This provides a way to check the current scheme in templates, for example.
It also allows us to deal with other schemes.

Thanks nslater for the suggestion.
2013-10-15 09:04:12 -04:00
Tim Graham 975415a8ce Fixed a webdesign template tag docstring to prevent parsing as metadata.
Previously admindocs would throw an error when processing it:
"Error in "default-role" directive: no content permitted."

refs #6681
2013-10-14 19:48:24 -04:00
Larry O'Neill 83b9bfea44 Fixed #21266 -- Fixed E201,E202 pep8 warnings. 2013-10-14 18:12:00 -04:00
Marc Tamlyn 8ce3c3a928 Merge pull request #1733 from joaoxsouls/#18866
Fixed #18866 -- added validation error for verbose_name longer than 39 characters
2013-10-14 06:20:59 -07:00
joaoxsouls 1ab27e9a65 Fixed #18866 -- added validation error for verbose_name longer than 39 characters
Added a validation error check when creating the permissions for model, to avoid
cryptic database error when the verbose_name is longer than 39 characters
thanks elena for reporting it
2013-10-14 14:19:35 +01:00
Claude Paroz 1e8eadc94e Fixed #15888 -- Made tablename argument of createcachetable optional
Thanks Aymeric Augustin for the report and the documentation and
Tim Graham for the review.
2013-10-14 13:24:40 +02:00
Claude Paroz ef22d512b5 Imported custom user classes in tests depending on it
Without those imports, affected test files cannot be run
independently. Refs #21164.
2013-10-14 10:14:24 +02:00
Claude Paroz 21c2bfdff3 Updated OpenLayers version from 2.11 to 2.13 2013-10-12 18:08:07 +02:00
Tim Graham b67ab75e82 Fixed assorted flake8 errors. 2013-10-11 07:25:14 -04:00
Claude Paroz 4b0f8d23c9 Sanitized test assertions in gdal tests 2013-10-10 23:02:31 +02:00
Tim Graham 1dae4ac177 Whitespace cleanup.
* Removed trailing whitespace.
* Added newline to EOF if missing.
* Removed blank lines at EOF.
* Removed some stray tabs.
2013-10-10 16:49:20 -04:00
Tim Graham adedc31072 Fixed "redefinition of unused 'foo' from line X" pyflakes warnings. 2013-10-10 11:09:42 -04:00
crccheck 4523fcd601 Fixed #19924 -- Fixed selectors in actions.js that did not use options. 2013-10-09 10:41:54 -04:00
Baptiste Mispelon 24f9967619 Fixed regression introduced by 20472aa827.
The wrong exception was being caught when detecting the presence of GeoIP.
Thanks to ramiro for the report.
2013-10-09 11:53:43 +02:00
Russell Keith-Magee ddb53856b6 Fixed #21164 -- Added documentation for issue with test users.
The package renaming restores the older package names (which were also the
documented package names). This doesn't affect test discovery because the
module in question doesn't contain any tests.

Thanks to Carl for the design discussion.
2013-10-08 10:32:56 +08:00
Ryan Allen 935001c4f1 Cleaned up admin CSS for consistency.
* header selected twice -merged
* match indentation throughout
* color names to hex

refs #21220.
2013-10-07 14:49:20 -04:00
Ryan Allen 3eab22a045 Added min-width for date and time inputs in admin.
refs #21220.
2013-10-07 14:29:58 -04:00
Simon Charette a8df8e34f9 Revert "Fixed #21241 -- Avoid extraneous JOINs in admin changelist search."
This reverts commit 698dd82eee.

The patch introduced a backward incompatible change.
2013-10-07 13:45:52 -04:00
Ryan Allen 259a6ea82c Added a link in admin branding block to admin index.
Refs #13749 and #21220.
2013-10-07 13:39:40 -04:00
Chris Adams 698dd82eee Fixed #21241 -- Avoid extraneous JOINs in admin changelist search. 2013-10-07 13:10:52 -04:00
Tim Graham 617aceb1b4 Fixed #18263 -- Corrrected handling of hidden fields in tabular admin inlines.
Thanks hvdklauw for the report and patch.
2013-10-07 12:30:02 -04:00
Étienne Loks 8d75d1e1bc Improved error message while setting GeometryProxy 2013-10-06 21:29:39 +02:00
Anssi Kääriäinen 1df3c49a1a Fixed #21174 -- transaction control in related manager methods 2013-10-05 23:07:52 +03:00
Baptiste Mispelon 20472aa827 Fixed #21189: Cleaned up usage of bare except clauses.
Thanks to berkerpeksag for the report and to claudep
for the review.
2013-10-05 11:50:03 +02:00
Simon Charette 948d209ada Fixed #21217 -- Avoid connecting `(pre|post)_init` signals to abstract senders. 2013-10-04 16:23:06 -04:00
Christopher Medrela dc3d2ac98c Fixed #11277 -- Hid labels of fields with HiddenInput widget in admin forms.
Thanks bartTC for the report.
2013-10-04 14:08:06 -04:00
Tai Lee bcd4c3f27d Fixed #6681 -- Don't break docutils when rendering reStructuredText.
Don't set a global default interpreted role function for reStructuredText.
Instead, use the `default-role` directive to change the default only within
the `parse_rst()` function.

Thanks Malcolm Tredinnick for the report.
2013-10-04 13:27:08 -04:00
Ryan Kaskel 8b0014869f Fixed #19321 -- Allowed redirect middleware HTTP responses to be overridden.
Thanks Melevir for the suggestion.
2013-10-04 07:36:39 -04:00
Anentropic c4db7f075e Fixed #19182 -- Fixed ModelAdmin.lookup_allowed to work with ('fieldname', SimpleListFilter) syntax.
Thanks gauss for the report.
2013-10-03 09:37:49 -04:00
Tim Graham 1285ca67eb Fixed #16919 -- Passed user to set_password_form in GET requests.
Thanks Jaime Irurzun for the report and initial patch and
ejucovy for the test.
2013-10-02 13:28:15 -04:00
tschilling 5381317fe3 Fixed #21129 -- Prevented admin filter params modifications from throwing an exception.
Thanks Tuttle for the report.
2013-10-02 08:16:09 -04:00
Ramiro Morales 1d0fc61b1c Fixed #15185 -- Allowed ModelAdmin.list_display_links=None to disable change list links.
Thanks rm_ for the suggestion.
2013-10-01 14:25:54 -04:00
Adam Haney d9bbda7149 * Fixing improper grammar 2013-09-30 16:59:45 -04:00
Loic Bistuer d847ddfe1d Fixed #3871 -- Fixed regression introduced by 04a2a6b.
Added do_not_call_in_templates=True attribute to RelatedManagers
to prevent them from being called.

Thanks jbg@ for the report.
2013-09-30 15:43:44 -04:00
Tim Graham 4745ea1d27 Added hints argument to GeoQuerySet; refs #13724. 2013-09-30 14:16:17 -04:00
Aymeric Augustin 728548e483 Fixed #21134 -- Prevented queries in broken transactions.
Squashed commit of the following:

commit 63ddb271a44df389b2c302e421fc17b7f0529755
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Sep 29 22:51:00 2013 +0200

    Clarified interactions between atomic and exceptions.

commit 2899ec299228217c876ba3aa4024e523a41c8504
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Sep 22 22:45:32 2013 +0200

    Fixed TransactionManagementError in tests.

    Previous commit introduced an additional check to prevent running
    queries in transactions that will be rolled back, which triggered a few
    failures in the tests. In practice using transaction.atomic instead of
    the low-level savepoint APIs was enough to fix the problems.

commit 4a639b059ea80aeb78f7f160a7d4b9f609b9c238
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Sep 24 22:24:17 2013 +0200

    Allowed nesting constraint_checks_disabled inside atomic.

    Since MySQL handles transactions loosely, this isn't a problem.

commit 2a4ab1cb6e83391ff7e25d08479e230ca564bfef
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sat Sep 21 18:43:12 2013 +0200

    Prevented running queries in transactions that will be rolled back.

    This avoids a counter-intuitive behavior in an edge case on databases
    with non-atomic transaction semantics.

    It prevents using savepoint_rollback() inside an atomic block without
    calling set_rollback(False) first, which is backwards-incompatible in
    tests.

    Refs #21134.

commit 8e3db393853c7ac64a445b66e57f3620a3fde7b0
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Sep 22 22:14:17 2013 +0200

    Replaced manual savepoints by atomic blocks.

    This ensures the rollback flag is handled consistently in internal APIs.
2013-09-30 09:42:27 +02:00
Baptiste Mispelon 8f51ba669a Fixed #21186: Fixed regression when using date fields in the admin's list_filter.
Thanks to onlygoldi2201 for the report and to ramiro and apollo13
for the reviews.
2013-09-28 00:40:43 +02:00
Loic Bistuer 04a2a6b0f9 Fixed #3871 -- Custom managers when traversing reverse relations. 2013-09-25 21:15:59 +03:00
Florian Apolloner 5d74853e15 Revert "Ensure that passwords are never long enough for a DoS."
This reverts commit aae5a96d57.

This fix is no longer necessary, our pbkdf2 (see next commit) implementation
no longer rehashes the password every iteration.
2013-09-24 21:01:21 +02:00
Michał Lech 53c7d66869 Marked PermissionsMixin.user_permissions help_text for translation 2013-09-24 07:36:24 -04:00
Claude Paroz 18fb713e7b Properly marked skipped GIS tests as skipped 2013-09-24 12:23:42 +02:00
Claude Paroz 45403d330a Reformatted some GIS distance tests 2013-09-24 12:23:42 +02:00
Aymeric Augustin a5b062576b Removed a few trailing backslashes.
We have always been at war with trailing backslashes.
2013-09-22 14:04:10 +02:00
Aymeric Augustin ee0ef1b094 Partial revert of 165f44aa.
That commit didn't always improve readability.

See discussion on django-developers for details.
2013-09-22 14:04:10 +02:00
tschilling 0d1ba84d13 Fixed #20702 -- Deprecated get_formsets in favor of get_formsets_with_inlines.
Thanks stanislas.guerra at gmail.com for the report.
2013-09-20 07:47:24 -04:00
Paul McMillan a075e2ad0d Increase default PBKDF2 iterations
Increases the default PBKDF2 iterations, since computers have gotten
faster since 2011. In the future, we plan to increment by 10% per
major version.
2013-09-19 18:02:25 +01:00
Tim Graham e23de9e350 Fixed typo in exception message; refs #19414
Thanks Alexey Boriskin for the report.
2013-09-19 06:24:12 -04:00
Brian Holdefehr 98514849dc Fixed #19414 -- Added admin registration decorator
Thanks stavros for the suggestion.
2013-09-18 11:44:10 -04:00
Florian Apolloner 2c6079775e Destroy selenium before live server threads.
Ensure that selenium quits before the live server thread to
prevent occasional hangs when killing the live server.
2013-09-17 18:39:25 +02:00
Florian Apolloner 73a610d2a8 Final attempt to solve sporadic test failures.
tearDownClass is not called if setUpClass throws an exception, in our case
this means that LiveServerTestCase leaks LiveServerThread sockets if the
test happens to be skipped later on, and AdminSeleniumWebDriverTestCase
doesn't close it's already open browser window. To prevent this leakage
we catch errors where needed and manually call _tearDownClassInternal.
_tearDownClassInternal should be written as defensively as possible since
it is not allowed to make any assumptions on how far setUpClass got.

This patch should fix the sporadic "Address already in use"-errors on jenkins
and also the "This code isn't under transaction management"-error for sqlite
(also just on jenkins).

After discussion with koniiiik, jezdez, kmtracey, tos9, lifeless, nedbat and
voidspace it was decided that this is the safest approach (thanks to everyone
for their comments and help). Manually calling tearDownClass was shut down
cause we don't know how our users override our classes.

This is a private and very specialized API on purpose and should not be used
without a strong reason!

This patch partially reverts the earlier attempts to fix those issues,
namely:
	2fa0dd73b1 and
	3c5775d36f

Final note: If this patch breaks in a later version of Django, please be
very careful on how you fix it, you might not see test failures locally.
That said, this patch hopefully doesn't produce even more failures.
2013-09-17 16:41:01 +02:00
Beshr Kayali 8e04ad9fc2 Added Arabic mapping to contrib/admin/static/admin/js/urlify.js 2013-09-17 10:34:12 -04:00
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
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
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
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
Keryn Knight 170f721367 Fixed #21056 -- AdminSite.app_index no longer blindly accepts any app-labelish input. 2013-09-11 08:48:32 -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
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
Aymeric Augustin d9413d33b2 Refactored code and tests that relied on django.utils.tzinfo.
Refs #17262.
2013-09-09 22:32:52 +02: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
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
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
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
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 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
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
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
Garry Polley 337bd248a5 fixes #19988, allow html in ordinal for humanize 2013-09-06 12:59:44 -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
Eric Boersma 4d13cc56de Fixed #21035 -- Changed docs to treat the acronym SQL phonetically.
The documentation and comments now all use 'an' to
refer to the word SQL and not 'a'.
2013-09-05 20:14:58 -04:00
Aymeric Augustin 6a6428a36f Took advantage of django.utils.six.moves.urllib.*. 2013-09-05 14:39:23 -05:00
CHI Cheng ed9cd4fd8b Fixed #21000 -- Made cached_db session backend respect SESSION_CACHE_ALIAS 2013-09-05 10:47:58 -04:00
Tim Graham 5649c0af9d Fixed "indentation is not a multiple of four" pep8 issues. 2013-09-03 14:22:21 -04:00
Claude Paroz dd656073ad Fixed #21003 -- Ensured geometry widget return value has SRID
Thanks Mathieu Leplatre for the report and initial patch.
2013-09-03 13:53:35 +02:00
Claude Paroz 3550b27a89 Isolated map creation JS code 2013-09-03 13:53:35 +02:00
Claude Paroz b6889c68d7 Prevented rendering attrs to be squashed in OSMWidget 2013-09-03 10:02:55 +02:00
Claude Paroz 6ecbac21a9 Fixed syntax error in OSMWidget 2013-09-03 09:05:01 +02:00
Claude Paroz 973502c047 Fixed gis test to run on non gis-enabled settings
Refs #20998.
2013-09-02 14:15:04 +02:00
Claude Paroz 102f26c929 Fixed #20998 -- Allow custom (de)serialization for GIS widgets
Thanks Mathieu Leplatre for the report and the initial patch.
2013-09-02 13:32:00 +02:00
Aymeric Augustin 868b4c921c Used six.moves.zip_longest, new in six 1.4.0. 2013-09-02 12:11:16 +02:00
Aymeric Augustin 365c3e8b73 Replaced "not PY3" by "PY2", new in six 1.4.0. 2013-09-02 12:11:02 +02:00
Ramiro Morales 17d898dedd Remove usage of deprecated module_name model option introduced in 1c0c879be3. 2013-09-01 09:58:33 -03:00
Claude Paroz 1c0c879be3 Fixed #17074 -- Improved first field detection in admin add form
Thanks Kidwind for the report and Julien Phalip for the initial
patch.
2013-08-31 21:19:22 +02:00
Ramiro Morales 92a710cd03 Updated Selenium-based tests after e909ceae9b. 2013-08-31 12:14:52 -03:00
Ramiro Morales e909ceae9b Made django.test.testcases not depend on staticfiles contrib app.
Do this by introducing a django.contrib.staticfiles.testing.StaticLiveServerCase
unittest TestCase subclass.

Fixes #20739.
2013-08-31 11:02:32 -03:00
Simon Charette 11cd7388f7 Fixed #20989 -- Removed useless explicit list comprehensions. 2013-08-30 10:57:51 -04:00
Tim Graham c7d0ff0cad Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
2013-08-29 12:11:03 -04:00
Tim Graham af953c45cc Fixed #16433 -- Fixed a help_text/read only field interaction that caused an admin crash.
Thanks chris at cogdon.org for the report and admackin for the patch.
2013-08-29 09:39:31 -04:00
Tim Graham cf8d6e9108 Fixed #20881 -- Removed contrib.auth.models.AbstractUser.get_absolute_url()
The definition is arbitrary and creates a broken "view on site"
link in the admin if a project doesn't define such a URL.
2013-08-29 06:36:35 -04:00
Michał Górny b89c2a5d9e Fixed #18171 -- Checked signature of authenticate() to avoid supressing TypeErrors.
The current auth backend code catches TypeError to detect backends that
do not support specified argumetnts. As a result, any TypeErrors raised
within the actual backend code are silenced.

In Python 2.7+ and 3.2+ this can be avoided by using inspect.getcallargs().
With this method, we can test whether arguments match the signature without
actually calling the function.

Thanks David Eyk for the report.
2013-08-28 07:51:45 -04:00
Erik Romijn fa57266699 Fixed #20972 -- Make messages cookie follow session cookie secure/httponly 2013-08-26 21:34:29 +02:00
Andrew Godwin 5569b0b92f Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/backends/oracle/base.py
	django/db/backends/postgresql_psycopg2/base.py
	django/db/models/signals.py
	tests/queries/tests.py
2013-08-23 12:36:53 +01:00
Tim Graham b0ce6fe656 Fixed #20922 -- Allowed customizing the serializer used by contrib.sessions
Added settings.SESSION_SERIALIZER which is the import path of a serializer
to use for sessions.

Thanks apollo13, carljm, shaib, akaariai, charettes, and dstufft for reviews.
2013-08-22 13:58:26 -04:00
Lukasz Balcerzak 9d1987d767 Fixed #19303 -- Fixed ModelAdmin.formfield_overrides on fields with choices 2013-08-22 11:50:52 -04:00
Rainer Koirikivi 65cf82bd08 Fixed #20934 -- Avoided NoReverseMatch in ModelAdmin.changelist_view
The view tried to display links to a ModelAdmin's change_view, which
resulted in NoReverseMatches if get_urls was overridden to remove the
corresponding url.
2013-08-22 10:08:54 -04:00
Ramiro Morales c5fbd16362 Import test case classes from their public API module. 2013-08-21 22:32:04 +01:00
Ramiro Morales deebb1a977 Import test case classes from their public API module. 2013-08-20 22:23:41 -03:00
Andrew Godwin b6a957f0ba Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	docs/ref/django-admin.txt
2013-08-19 18:30:48 +01:00
Rainer Koirikivi 3c03004050 Fixed #20640 -- Avoided NoReverseMatch in get_deleted_objects
The default delete action resulted in a NoReverseMatch if it were to
list any Model with a ModelAdmin with `get_urls` overridden to remove
the change url.  Catching the error and not displaying the link in that
case, as was already done for models with no registered admins.

Thanks Keryn Knight for the report.
2013-08-19 12:01:33 -04:00
Anssi Kääriäinen ddeb20e31b Fixed GIS regression caused by force_subq
Caused by commit 7737305a4f
2013-08-19 16:35:11 +03:00
Anssi Kääriäinen 3844089edc Fixed #20777 -- Admin proxy model deletion regression
Added proxy_models tests by Harm Geerts <github@geertswei.nl>.
2013-08-19 09:51:41 +03:00
Harm Geerts 240886183b Fixed #20829 -- Skip postgis metadata tables with introspection 2013-08-16 21:14:29 +02:00
Claude Paroz 165f44aaaa Combine consecutive with statements
Python 2.7 allows to combine several 'with' instructions.
2013-08-16 20:12:10 +02:00
Alasdair Nicol 22c6497f99 Fixed #20895 -- Made check management command warn if a BooleanField does not have a default value
Thanks to Collin Anderson for the suggestion and Tim Graham for
reviewing the patch.
2013-08-15 19:47:26 -04:00
SusanTan 71c491972e Fixed #11400 -- Passed kwargs from AbstractUser.email_user() to send_mail()
Thanks Jug_ for suggestion, john_scott for the initial patch,
and Tim Graham for code review.
2013-08-14 07:46:11 -04:00
Jacob Kaplan-Moss cbe6d5568f Apply autoescaping to AdminURLFieldWidget.
This is a security fix; disclosure to follow shortly.
2013-08-13 11:06:41 -05:00
Jacob Kaplan-Moss ae3535169a Fixed is_safe_url() to reject URLs that use a scheme other than HTTP/S.
This is a security fix; disclosure to follow shortly.
2013-08-13 11:06:22 -05:00
Tim Graham 737b53ab9a Merge pull request #1470 from loic/admin.actionlist
Fixed overflow for the "Recent Actions" widget on the admin index.
2013-08-13 05:11:39 -07:00
Loic Bistuer 33fc083b0d Fixed overflow for the "Recent Actions" widget on the admin index.
Previously the CSS targeted "li.changelink" and therefore didn't
work for the "add" and "delete" actions.

Refs #14868.
2013-08-13 18:20:12 +07:00
ersran9 00d23a13eb Fixed #20828 -- Allowed @permission_required to take a list of permissions
Thanks Giggaflop for the suggestion.
2013-08-10 10:10:18 -04:00
Tim Graham 453915bb12 SQLite test fix -- refs #9057 2013-08-09 10:57:25 -04:00
Andrew Godwin 588b523233 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/db/models/options.py
2013-08-09 14:37:37 +01:00
Tim Graham ddae74b64c Fixed #9057 -- Added default_permissions model meta option.
Thanks hvendelbo for the suggestion and koenb for the draft patch.
2013-08-09 09:19:52 -04:00
Andrew Godwin de64c4d6e9 Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
	django/core/management/commands/flush.py
	django/core/management/commands/syncdb.py
	django/db/models/loading.py
	docs/internals/deprecation.txt
	docs/ref/django-admin.txt
	docs/releases/1.7.txt
2013-08-09 14:17:30 +01:00
Collin Anderson d53e574676 Fixed #20865 -- Fixed raw_id_fields to work with callable limit_choices_to. 2013-08-06 13:41:52 -04:00
Justin Michalicek 6d88d47be6 Fixed #20832 -- Enabled HTML password reset email
Added optional html_email_template_name parameter to password_reset view
and PasswordResetForm.
2013-08-05 09:47:28 -04:00
Alex Gaynor 3e0eb2d788 Fixed a number of lint warnings, particularly around unused variables. 2013-08-04 09:17:10 -07:00
Loic Bistuer ebb3e50243 Introduced ModelAdmin.get_fields() and refactored get_fieldsets() to use it.
Refs #18681.

This also starts the deprecation of ModelAdmin.declared_fieldsets
2013-08-04 09:14:18 -04:00
Tim Graham 59f58bf731 Merge pull request #1432 from loic/modeladmin.get_search_results
Moved get_search_results from BaseModelAdmin to ModelAdmin.
2013-08-04 04:17:34 -07:00
Curtis Maloney 07876cf02b Deprecated SortedDict (replaced with collections.OrderedDict)
Thanks Loic Bistuer for the review.
2013-08-04 07:09:39 -04:00
Loic Bistuer 470a9bb22d Moved get_search_results from BaseModelAdmin to ModelAdmin.
Refs #15961.
2013-08-04 17:18:17 +07:00
Loic Bistuer 0bcdcc7eb9 Added ModelAdmin.get_search_fields. 2013-08-03 20:02:43 -04:00
Tim Graham 425d076d0c Fixed #18923 -- Corrected usage of sensitive_post_parameters in contrib.auth
Thanks Collin Anderson for the report.
2013-08-02 14:46:17 -04:00
Petr Dlouhý 1b47508ac8 Fixed LogEntry.get_admin_url() for non-existent models.
Regression introduced by [369b6fa]; refs #18169.
2013-08-02 12:51:10 -04:00
Loic Bistuer a0ed2f9260 Fixed #18681 -- GenericInlineModelAdmin.get_formset() no longer bypasses get_fieldsets().
Refs 23e1b59 which already fixed this issue for ModelAdmin and InlineModelAdmin.
2013-08-02 10:41:29 -04:00
Harm Geerts fd0d486467 Fixed #20838 -- Fixed Geodjango spatialrefsys test failure with postgis-2.0.3 2013-08-02 09:26:53 -04:00
Tim Graham a1889397a9 Fixed #12103 -- Added AuthenticationForm.confirm_login_allowed to allow customizing the logic policy.
Thanks ejucovy and lasko for work on the patch.
2013-07-31 13:54:05 -04:00
Tai Lee 31e6d58d46 Fixed #20348 -- Consistently handle Promise objects in model fields.
All Promise objects were passed to force_text() deep in ORM query code.
Not only does this make it difficult or impossible for developers to
prevent or alter this behaviour, but it is also wrong for non-text
fields.

This commit changes `Field.get_prep_value()` from a no-op to one that
resolved Promise objects. All subclasses now call super() method first
to ensure that they have a real value to work with.
2013-07-31 15:54:17 +03:00
Julian Bez 8f5533ab25 Fixed #20793 -- Added Last-Modified header to sitemaps. 2013-07-31 07:42:30 -04:00
Tai Lee 4c6ffcf721 Fixed #20819 -- Return 404 instead of 500 error when ``staticfiles`` view is used in production. 2013-07-31 18:58:50 +10:00
Kirill Zaitsev dafec05548 Updated flatpages tests to override CSRF_FAILURE_VIEW. 2013-07-30 13:04:30 -04:00
Aymeric Augustin 5b47a9c5a0 Fixed a test that could fail depending on PASSWORD_HASHERS.
Thanks Claude. Refs #20760.
2013-07-30 16:14:53 +02:00
Andrew Godwin 12e9804d16 Rename allow_syncdb to allow_migrate 2013-07-30 12:08:59 +01:00
Andrew Godwin 68e0a169c4 Rename pre_ and post_syncdb to *_migrate, with aliases from old names 2013-07-30 11:52:52 +01:00
Julien Phalip 53e9ab72e9 Updated some minified admin javascript files. 2013-07-30 00:21:33 -07:00
Julien Phalip e351dbf6ee Fixed #19082 -- Enabled admin field pre-population for existing objects.
Thanks to msaelices and d1ffuz0r for the initial patch and tests.
2013-07-30 00:21:08 -07:00
Claude Paroz 5c1143910e Removed most of absolute_import imports
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
2013-07-29 20:28:13 +02:00
Tim Graham 402b4a7a20 Fixed #14850 -- Cleaned up duplicate code in admin formset handling.
Thanks apollo13 for the report and review.
2013-07-29 12:37:43 -04:00
Claude Paroz fdd7a355bf Deprecated django.utils.importlib
This was a shim for pre-Python 2.7 support.
2013-07-29 17:10:22 +02:00
Julien Phalip 4e0ff35146 Fixed #11195 -- Added CSS classes to the changelist cells to allow style customizations. Thanks to akaihola, Ramiro Morales and vdboor for their work on the patch. 2013-07-27 19:50:02 -07:00
Julien Phalip 47c755327b Fixed a number of minor misspellings. 2013-07-27 18:46:03 -07:00
Serge G. Spaolonzi e07e4030b9 Fixed #18511 -- Cleaned up admin password reset template titles. 2013-07-27 14:23:04 -04:00
Tim Graham 8676318d2d Fixed #20805 -- Removed an extra colon beside checkboxes in the admin.
Thanks CollinAnderson for the report.
2013-07-26 14:45:38 -04:00
Tim Graham 2a979d2a7b Updated contrib.admin to use Email/URLInputs; refs #16630 2013-07-26 07:22:30 -04:00
Tim Graham 9b88dd3809 Fixed #20679 -- Corrected CachedFilesMixin.post_process docstring.
Thanks bmispelon for the report.
2013-07-25 12:31:53 -04:00
Pedro Mourelle fb052b528a Fixed #19900 -- Updated admin buttons to use CSS3 rounded corners. 2013-07-23 11:28:22 -04:00
Aymeric Augustin 5dbca13f3b Fixed #20760 -- Reduced timing variation in ModelBackend.
Thanks jpaglier and erikr.
2013-07-23 15:43:12 +02:00
Kirill Fomichev 33242fe015 Fixed #19019 -- Fixed UserAdmin to log password change.
Thanks Tuttle for the report.
2013-07-23 08:33:07 -04:00
Marc Tamlyn 29a09b3638 Merge pull request #1390 from garnertb/master
Fixed small grammatical error in docstring.
2013-07-22 07:34:30 -07:00
Tyler Garner 8e98652416 Fixed small grammatical error in docstring. 2013-07-22 10:32:09 -04:00
Claude Paroz 27c1a72576 Fixed #20773 -- [gis] Fixed regression in GoogleMap output
Thanks Martyn Clement for the report and the initial patch.
2013-07-22 09:55:45 +02:00
Thomas Sorrel bb145e2c47 Fixed #13629 -- Added CSS classes to the `<body>` tag of some admin templates to allow style customizations per app or per model. 2013-07-21 20:17:14 +00:00
Karen Tracey 3aad955ea8 Fixed #13696 -- ensured inline pk field is rendered 2013-07-21 13:06:11 -04:00
Matt Deacalion Stevens a269ea4fe0 Fixed #14656 -- Added Atom1Feed `published` element
Some feed aggregators make use of the `published` element as well as
the `updated` element (within the Atom standard -- http://bit.ly/2YySb).

The standard allows for these two elements to be present in the same
entry. `Atom1Feed` had implemented the `updated` element which was
incorrectly taking the date from `pubdate`.
2013-07-19 10:38:34 -04:00
Loic Bistuer 2fc6c9472c Fixed #20767 -- Fixed ModelAdmin.preserve_filters for namespaced URLs.
Thanks Collin Anderson for the report.
2013-07-18 18:18:30 -04:00
Loic Bistuer 3a00229189 Cleaned up UserAdmin.get_form() that worked around a bug fixed in 23e1b59.
Refs #18681.
2013-07-18 23:59:45 +07:00
Tim Graham 828359e52d Couple of cleanups in RelatedObjectLookups.js
Thanks George Karpenkov.
2013-07-17 09:32:14 -04:00
Loic Bistuer 7e6d852bac Fixed #20663 -- "Today" and "now" admin shortcuts.
Changed the shortcuts next to date and time intput widgets
to account for the current timezone.

Refs #7717, #14253 and #18768.
2013-07-09 23:04:33 +02:00
Claude Paroz 6157192b6e Added a test for the envelope() GeoQuerySet method
Refs #20718.
2013-07-09 20:37:01 +02:00
Claude Paroz 550b6195ed Made an aggregate test pass with spatialite backend
backends.tests.SqliteAggregationTests was failing with spatialite.
2013-07-09 19:47:57 +02:00
Claude Paroz bd563f0f57 Trusted test skipping about gis tests running or not
With the new test discovery system, gis tests are discovered as
other tests. They should be properly skipped now when dependencies
are missing. So let's stop special casing their inclusion.
2013-07-09 15:17:26 +02:00
Claude Paroz 74bc63b109 Isolate geoapp test from sitemaps app being installed or not 2013-07-09 15:14:11 +02:00
Claude Paroz 57815e2630 Partial revert of commit 2bf403ecbd
Homework: write 100 times geoapp is not geogapp.
2013-07-09 13:13:43 +02:00
Alex Gaynor 6bdc47f75c Use a more explicit check for whether these ids are None. 2013-07-08 12:44:17 +10:00
Alex Gaynor df3d7e66da Replaced some dicts with sets. 2013-07-08 09:48:56 +10:00
Claude Paroz c94093c5ba [gis] Dropped official support for GDAL < 1.6 2013-07-06 17:25:46 +02:00
Claude Paroz 4367c637d6 Tweaked proj string regex in gis tests 2013-07-06 14:26:28 +02:00
Claude Paroz 7442eb1a24 Fixed #20224 -- Update docs examples which mention __unicode__
Thanks Marc Tamlyn and Tim Graham for the review.
2013-07-05 19:27:07 +02:00
Tim Graham f407f75aae Fixed #20673 -- Clarified that HttpRequest.user uses AUTH_USER_MODEL.
Thanks littlepig for the report.
2013-07-04 09:32:32 -04:00
Simon Charette 8759778185 Fixed #20675 -- `check_password` should work when no password is specified.
The regression was introduced by 2c4fe761a. refs #20593.
2013-07-03 14:09:58 -04:00
Aymeric Augustin e021b87c00 Fixed a few more imports of django.utils.unittest.
One import per line please! Refs #20680.
2013-07-01 22:49:07 +02:00
Tim Graham a6a905c619 Updated tests for deprecation of Option.get_(add|change|delete)_permission.
refs #20642.
2013-07-01 09:19:55 -04:00
Aymeric Augustin cfcf4b3605 Stopped using django.utils.unittest in the test suite.
Refs #20680.
2013-07-01 14:29:33 +02:00
Matt Robenolt 5ff2ffa330 Define the SessionStore inside __init__ instead of process_request
It's unnecessary to run this on every request, since technically, settings *should be* immutable.
2013-06-30 09:43:02 +02:00
Ramiro Morales 5e3a6532aa Merge pull request #1316 from ramiro/int_pk_pwd_reset 2013-06-29 14:02:08 -07:00
Tim Graham 3fd0ee5b46 Fixed #20677 - Typos in generic_inlineformset_factory docs.
Thanks Riley Strong for the report.
2013-06-29 14:14:32 -04:00
Aymeric Augustin acd7b34aaf Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
Ramiro Morales d51b7794bf Removed django.contrib.auth.views.password_reset_confirm_uidb36() view to finish its accelerated deprecation schedule. 2013-06-29 12:22:15 -03:00
Claude Paroz 6118d6d1c9 More import removals
Following the series of commits removing deprecated features in
Django 1.7, here are some more unneeded imports removed and other
minor cleanups.
2013-06-29 11:58:36 +02:00
Aymeric Augustin c8756e17fb Removed obsolete comment. Refs #20079.
Thanks Gavin Wahl.
2013-06-29 11:42:34 +02:00
Ramiro Morales 425a429208 Made GeoDjango GeometryField stop accepting a 'null' keyword argument as per its deprecation in 1.5. 2013-06-28 23:16:06 -03:00
Ramiro Morales 8eadbc5a03 Removed 'mimetype' arguments from a few places, as per deprecation TL.
This includes HttpResponse and co. __init__() methods,
django.shortcuts.render_to_response() and the index(), sitemap() sitemap
app views.
2013-06-28 21:48:16 -03:00
Ramiro Morales c196564132 Removed custom profile model functionality as per deprecation TL. 2013-06-28 21:48:16 -03:00
Ramiro Morales f02a703ca6 Removed AuthenticationForm.check_for_test_cookie() as per deprecation TL. 2013-06-28 21:48:15 -03:00
Tim Graham 534ced5aad Fixed #20664 -- Fixed a bug with raw_id_fields on Python 3.
Thanks jefftriplett for the report.
2013-06-27 19:39:20 -04:00
Andrew Godwin f325f86971 Fixed #20244: PermissionsMixin now defines a related_query_name for M2Ms 2013-06-27 15:44:22 +01:00
Anton Baklanov cab333cb16 Fixed #20541 -- don't raise db signals twice when creating superuser 2013-06-27 05:58:01 -04:00
Tim Graham 1184d07789 Fixed #14881 -- Modified password reset to work with a non-integer UserModel.pk.
uid is now base64 encoded in password reset URLs/views. A backwards compatible
password_reset_confirm view/URL will allow password reset links generated before
this change to continue to work. This view will be removed in Django 1.7.

Thanks jonash for the initial patch and claudep for the review.
2013-06-26 13:11:47 -04:00
Simon Charette b91787910c Fixed #20642 -- Deprecated `Option.get_(add|change|delete)_permission`.
Those methods were only used by `contrib.admin` internally and exclusively
related to `contrib.auth`. Since they were undocumented but used
in the wild the raised deprecation warning point to an also undocumented
alternative that lives in `contrib.auth`.

Also did some PEP8 and other cleanups in the affected modules.
2013-06-25 12:22:37 -04:00
Javier Mansilla f819bef3dc Fixed #19773 - Added admin/popup_response.html template.
Thanks jimmylam@ for the suggestion.
2013-06-25 11:20:41 -04:00
Christian Metts c4a0c91459 Itty bitty typo fix.
"deletes" was missing it's last e.
2013-06-19 17:45:28 -06:00
Loic Bistuer 7462a78c1b Fixed #20288 -- Fixed inconsistency in the naming of the popup GET parameter.
Thanks to Keryn Knight for the initial report and reviews,
and to tomask for the original patch.
2013-06-19 22:16:16 +02:00
Aymeric Augustin ffcf24c9ce Removed several unused imports. 2013-06-19 17:18:40 +02:00
Aymeric Augustin 9da9b3eb04 Merge pull request #1281 from loic/ticket6903
Fixed #6903 - Preserved admin changelist filters.
2013-06-18 13:07:28 -07:00
Loic Bistuer c86a9b6398 Fixed #6903 - Preserve admin changelist filters after saving or deleting an object 2013-06-19 02:41:36 +07:00
Erik Romijn aeb1389442 Fixed #20079 -- Improve security of password reset tokens 2013-06-18 20:02:00 +02:00
Erik Romijn 2c4fe761a0 Fixed #20593 -- Allow blank passwords in check_password() and set_password() 2013-06-18 13:32:54 -04:00
Loic Bistuer ee77d4b253 Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields 2013-06-18 08:01:17 -04:00
Baptiste Mispelon 1b7634a0d0 Fixed #20464 -- Added a `total_error_count` method on formsets.
Thanks to frog32 for the report and to Tim Graham for the review.
2013-06-16 15:49:30 -04:00
Claude Paroz beb652e069 Worked around Python 3.3 modified exception repr
Refs #20599.
2013-06-15 11:14:59 +02:00
Jaap Roes 990f8d92dc Fixed #20599 -- Changed wording of ValueError raised by _load_library
The _load_library method on BasePasswordHasher turns ImportErrors
into ValueErrors, this masks ImportErrors in the algorithm library.
Changed it to a clearer worded error message that includes
the ImportError string.
2013-06-15 10:50:55 +02:00
Aymeric Augustin c6e6d4eeb7 Defined available_apps in relevant tests.
Fixed #20483.
2013-06-10 11:30:01 +02:00
Aymeric Augustin 4daf570b98 Added TransactionTestCase.available_apps.
This can be used to make Django's test suite significantly faster by
reducing the number of models for which content types and permissions
must be created and tables must be flushed in each non-transactional
test.

It's documented for Django contributors and committers but it's branded
as a private API to preserve our freedom to change it in the future.

Most of the credit goes to Anssi. He got the idea and did the research.

Fixed #20483.
2013-06-10 11:24:10 +02:00
Chris Streeter 69373f3420 Fixed #19925 - Added validation for REQUIRED_FIELDS being a list
Thanks Roman Alexander for the suggestion.
2013-06-07 19:58:41 -04:00
Claude Paroz b67f2ac8e6 Fixed #20502 (again) -- More i18n cache flush in tests
Thanks Timo Graham for noticing the failures.
2013-06-06 14:28:58 +02:00
Marc Tamlyn 9ed971f4f1 Merge pull request #1245 from oinopion/list_select_related
Fixed #19080 -- Fine-grained control over select_related in admin
2013-06-06 01:27:05 -07:00
Tomek Paczkowski 0fd9f7c95f Fixed #19080 -- Fine-grained control over select_related in admin 2013-06-05 23:08:00 +02:00
Bojan Mihelac b00c6371af Fixed #17927 -- Added initial values support for BaseGenericInlineFormSet
Thanks Fak3 for the suggestion.
2013-06-05 07:59:59 -04:00
Gavin Wahl 4f4e9243e4 Fixed #20532 -- Reverse auth views by name, not by path.
Auth views should be reversed by name, not their locations in
`django.contrib.auth.views`. This allows substituting your own
implementations of the auth views.
2013-06-03 13:30:40 -04:00
Simon Charette 590a41164e Fixed admindoc template errors introduced by 02fd87c821.
Also regenerated the affected translation template.

Refs #20540.
2013-06-02 00:32:29 -04:00
Tim Graham 61524b09cf Fixed #18388 - Added InlineModelAdmin.get_max_num hook.
Thanks d.willy.c.c@ for the suggestion and Melevir and Areski Belaid for work
on the patch.
2013-06-01 18:20:54 -04:00
Claude Paroz 5442fe46da Updated contrib.admindocs translation template 2013-06-01 12:10:48 +02:00
Claude Paroz 02fd87c821 Fixed #20540 -- Added more translatable strings to contrib.admindocs
Thanks lborgav for the initial patch.
2013-06-01 12:06:36 +02:00
Loic Bistuer 23e1b59cf2 Fixed #18681 -- BaseModelAdmin.get_form and InlineModelAdmin.get_formset no longer bypass get_fieldsets
Thanks msopacua for the report.
2013-05-31 12:48:51 -04:00
Claude Paroz 3d883e8bd9 Merge pull request #1232 from fusionbox/normalize_email
Fixed #20531 -- Don't hard-code class names when calling static methods
2013-05-31 00:56:56 -07:00
Tim Graham 36aecb12b8 Fixed #19425 - Added InlineModelAdmin.get_extra hook.
Thanks dave@ for the suggestion and Rohan Jain for the patch.
2013-05-30 13:48:10 -04:00
Gavin Wahl 01ae881bb4 Don't hard-code class names when calling static methods
normalize_email should be called on the instance, not the class. This
has the same effect normally but is more helpful to subclassers. When
methods are called directly on the class, subclasses can't override
them.
2013-05-29 16:11:26 -06:00
Tim Graham d727518ad6 Fixed #20331 -- Allowed admin actions to serve StreamingHttpResponses
Thanks Edwin.
2013-05-29 11:25:42 -04:00
Tim Graham 5939864616 Fixed #15653 - Error in admin pagination tag.
Thanks jcumbo@ for the report and adamzap
and nott for the patch.
2013-05-29 09:23:08 -04:00
Tim Graham 0268aba96b Fixed #20182 - admin lookup should treat 0 as False for __isnull
Thanks Benjie Chen.
2013-05-27 13:29:53 -04:00
Ramiro Morales 7a92312827 Fixed #12491 -- Tweak checkbox widget help text alignment on the admin.
Thanks master' for the report and Niels van Dijk for the fix
2013-05-27 08:47:18 -03:00
Claude Paroz b14bd60404 Reimplemented PostGIS spatial_version with cached_property 2013-05-27 12:06:56 +02:00
Ramiro Morales 0fa8d43e74 Replaced `and...or...` constructs with PEP 308 conditional expressions. 2013-05-26 23:47:50 -03:00
Preston Holmes d228c1192e Fixed #19866 -- Added security logger and return 400 for SuspiciousOperation.
SuspiciousOperations have been differentiated into subclasses, and
are now logged to a 'django.security.*' logger. SuspiciousOperations
that reach django.core.handlers.base.BaseHandler will now return a 400
instead of a 500.

Thanks to tiwoc for the report, and Carl Meyer and Donald Stufft
for review.
2013-05-25 16:27:34 -07:00
Claude Paroz ab61dd2829 Updated translation catalogs
Updated core/admin/admindocs/comments translation catalogs.
2013-05-25 14:32:44 +02:00
Claude Paroz b7cf44dde8 Fixed some minor translation-related issues 2013-05-25 14:32:44 +02:00
Marc Egli b3bccce1a0 Fixed #20455 -- Do not use ngettext for undefined plurals
Using two separate translation strings instead of gettext plural when
there is no reference to the number in the translated string. This
prevents some translations like Russian and Latvian to use the singular
form for 11 or 21.
2013-05-25 14:16:46 +02:00
Andrew Godwin 1514f17aa6 Rotate CSRF token on login 2013-05-24 22:15:08 +01:00
Gavin Wahl 48424adaba Fixed #17648 -- Add `for_concrete_model` to `GenericForeignKey`.
Allows a `GenericForeignKey` to reference proxy models. The default
for `for_concrete_model` is `True` to keep backwards compatibility.

Also added the analog `for_concrete_model` kwarg to
`generic_inlineformset_factory` to provide an API at the form level.
2013-05-23 19:03:14 -04:00
Claude Paroz d595b61aca (Re-)moved some imports 2013-05-21 17:34:19 +02:00
Wiktor Kolodziej cec9558fba Fixed #17308 -- Enabled the use of short_description on properties in the admin. 2013-05-21 13:19:18 +02:00
Aymeric Augustin f7d7d2be4b Made 2d309a70 compatible with Python 3. 2013-05-19 17:58:29 +02:00
Russell Keith-Magee a4ab0e8b86 Merge pull request #1178 from bmispelon/master
Fix for test failure introduced by 980ae2a.
2013-05-19 08:08:09 -07:00
Baptiste Mispelon 3cb1e9b93c Fix test failure introduced by 980ae2ab29. 2013-05-19 16:51:36 +02:00
Bozidar Benko 2d309a7043 Fixed #15961 -- Modified ModelAdmin to allow for custom search methods.
This adds a get_search_results method that users can override to
provide custom search strategies.

Thanks to Daniele Procida for help with the docs.
2013-05-19 16:45:00 +02:00
Erik Romijn f88700d610 Fix #19664 -- Illegal Characters In Session Key Give Fatal Error On File Backend Only 2013-05-19 15:33:05 +02:00
Baptiste Mispelon 980ae2ab29 Fix #20447: URL names given to contrib.auth.views are now resolved.
This commit also adds tests for the redirect feature of most auth views.
It also cleans up the tests, most notably using @override_settings instead
of ad-hoc setUp/tearDown methods.

Thanks to caumons for the report.

Conflicts:
	docs/releases/1.6.txt
2013-05-19 14:36:38 +02:00
Andrew Godwin 9b22baddef Merge pull request #1130 from vdboor/issue_20442_get_for_id
Fixed #20442: NoneType error when fetching a stale ContentType with get_for_id
2013-05-19 05:33:17 -07:00
Łukasz Langa 660762681c Fixed #20126 -- XViewMiddleware moved to django.contrib.admindocs.middleware 2013-05-19 13:18:35 +02:00
Honza Kral 4ad1eb1c14 Fixed #12674 -- provide a way to override admin validation
Moved admin validation code to classes and have those be class
attributes to the ModelAdmin classes.
2013-05-19 12:42:52 +02:00
Peter Inglesby cafcc22b01 Typo in comment 2013-05-19 09:28:36 +02:00
Claude Paroz 69523c1ba3 Updated contrib.humanize translation template 2013-05-18 23:11:39 +02:00
Emil Stenström 7d77e9786a Fixed #20246 -- Added non-breaking spaces between values an units 2013-05-18 23:01:48 +02:00
Diederik van der Boor 86e761fee8 Fix NoneType error when fetching a stale ContentType with get_for_id
When a stale ContentType is fetched, the _add_to_cache() function
didn't detect that `model_class()` returns `None` (which it does by
design). However, the `app_label` + `model` fields can be used instead
to as local cache key. Third party apps can detect stale models by
checking whether `model_class()` returns `None`.

Ticket: https://code.djangoproject.com/ticket/20442
2013-05-18 17:31:28 +02:00
Łukasz Langa 64e11a68f1 Fixed #13285: populate_xheaders breaks caching 2013-05-18 17:03:43 +02:00
Claude Paroz 710c59bf9b Slightly reworked imports in contrib.auth.__init__ 2013-05-18 16:01:47 +02:00
Jorge Bastida dc43fbc2f2 Fixed #18998 - Prevented session crash when auth backend removed
Removing a backend configured in AUTHENTICATION_BACKENDS should not
raise an exception for existing sessions, but should make already
logged-in users disconnect.
Thanks Bradley Ayers for the report.
2013-05-18 15:58:29 +02:00
Jacob Burch 340115200f Fixed #20432 -- Test failure in admin_views.
The failure was triggered by a cache leak.
2013-05-18 13:13:33 +02:00
Aymeric Augustin 9c487b5974 Replaced an antiquated pattern.
Thanks Lennart Regebro for pointing it out.
2013-05-17 18:08:58 +02:00
Preston Holmes b1bfd9630e Remove unnecessary and problematic parent class from SuccessMessageMixin
refs #16319, thanks to bmispelon for the catch
2013-05-17 08:59:06 -07:00
Claude Paroz b16b72d415 Fixed #5472 --Added OpenLayers-based widgets in contrib.gis
Largely inspired from django-floppyforms. Designed to not depend
on OpenLayers at code level.
2013-05-17 13:33:40 +02:00
Mark Huang 0732c8e8c6 Fixed #20357 -- Allow empty username field label in `AuthentificationForm`. 2013-05-16 11:41:52 -04:00
Tim Graham 79715f267c Fixed misleading heading on admindocs models page; refs #19712. 2013-05-16 08:37:20 -04:00
Claude Paroz 0a29057ebe Fixed #20415 -- Ensured srid is not localized in openlayers template
Thanks pierremarc07 at gmail.com for the report.
2013-05-16 13:48:38 +02:00
Mike Fogel 3188775174 Fix bug introduced in contrib.gis in 74f3884ae0 2013-05-15 14:07:34 -07:00
Mike Fogel 74f3884ae0 Fixed #20413 - Respect Query.get_meta() 2013-05-15 12:55:30 -07:00
Florian Apolloner ebfb71c64a Fixed previous commit. (Don't commit from DjangCon!) 2013-05-15 16:50:33 +02:00
Florian Apolloner f6d1ca56c9 Don't unregister OSMGeoAdmin, other tests rely on it. 2013-05-15 16:47:03 +02:00
Donald Stufft 8f0a4665d6 Recommend using the bcrypt library instead of py-bcrypt
* py-bcrypt has not been updated in some time
* py-bcrypt does not support Python3
* py3k-bcrypt, a port of py-bcrypt to python3 is not compatible
  with Django
* bcrypt is supported on all versions of Python that Django
  supports
2013-05-13 23:49:00 -04:00
Florian Apolloner a6edde3260 Fixed embarrassing typo. 2013-05-11 22:57:01 +02:00
Florian Apolloner 01820466ca Don't hardcode primary keys in gis tests. 2013-05-11 22:42:39 +02:00
Donald Stufft 11c7ec7993 Merge pull request #1052 from dstufft/bcrypt-python3
BCrypt on Python3
2013-05-11 10:53:18 -07:00
Florian Apolloner 2bf403ecbd Fixed a regression from e23a5f9a47.
Excluded postgis specific gis tests from other spatial databases.

Refs #17365, #17366, #18727.
2013-05-11 18:29:08 +02:00
Donald Stufft 3070e8f711 Properly force bytes or str for bcrypt on Python3 2013-05-11 11:16:06 -04:00
Carl Meyer 9012833af8 Fixed #17365, #17366, #18727 -- Switched to discovery test runner.
Thanks to Preston Timmons for the bulk of the work on the patch, especially
updating Django's own test suite to comply with the requirements of the new
runner. Thanks also to Jannis Leidel and Mahdi Yusuf for earlier work on the
patch and the discovery runner.

Refs #11077, #17032, and #18670.
2013-05-10 23:08:45 -04:00
Claude Paroz 7b00d90208 [py3] Made GeoIP tests pass with Python 3 2013-05-10 13:21:07 +02:00
Claude Paroz 465a29abe0 Fixed #20384 -- Forced GeoIP_open path argument to bytestring
Thanks Julian Wachholz for the report.
2013-05-10 13:21:07 +02:00
Luke Plant f026a519ae Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory
 and modelformset_factory, and the generic views `ModelFormMixin`,
 `CreateView` and `UpdateView` which gain a new `fields` attribute.
2013-05-09 16:44:36 +01:00
Luke Plant 1e37cb37ce Further removal of static admin validation that can fail erroneously 2013-05-09 16:44:36 +01:00
Aymeric Augustin 1906cb9360 Fixed conditional skipping of test for left/right lookup types.
connection.ops.spatial_version is None for some backends (eg. MySQL) and
the comparison fails on Python 3 with TypeError.
2013-05-09 17:39:56 +02:00
Alex Gaynor a53d7a0a50 Made gis_terms be a set, rather than a dict with None for all keys. 2013-05-09 08:13:13 -07:00
Alex Gaynor f25fc5b220 Merge pull request #1049 from mfogel/remove-unescessary-parameter-checks
Remove unnecessary check on __set__ parameters.
2013-05-08 21:20:58 -07:00
Luke Plant 1556b1c3b7 Removed fragile admin validation of fields on ModelForm
Refs #19445
2013-05-09 00:49:05 +01:00
Mike Fogel a22e15effc Remove unnecessary check on __set__ parameters. 2013-05-07 21:50:59 -07:00
Claude Paroz f3b3c569e7 One more changed import location of wraps 2013-05-04 13:29:40 +02:00
Claude Paroz 66c83dce07 Fixed #18351 -- Added X-Robots-Tag header to sitemaps
Thanks Michael Lissner for the report and initial patch, and
Tom Mortimer-Jones for working on the patch.
2013-05-04 12:08:15 +02:00
Claude Paroz 9f7a01ef2b Updated translation templates and removed en translations
"en" translations have been mistakenly committed in 87cc3da81.
2013-05-02 16:25:23 +02:00
Aymeric Augustin 90fe9141de Fixed #18986 -- Improved error message for missing files
in CachedStaticFilesStorage. Thanks zyegfryed for his work on the patch.
2013-04-28 16:45:05 +02:00
Claude Paroz 53df89c0fe Updated get_ogr_db_string in inspectapp tests to support MySQL/Spatialite
The OGRInspectTest.test_time_field does still not succeed with these
databases (even when removing the postgis guard), but at least it's now
possible to setup a datasource.
2013-04-15 20:27:58 +02:00
Claude Paroz 1628dfd0b9 Properly used test skipping in OGRInspectTest TestCase 2013-04-15 19:38:24 +02:00
Matthew Tretter a506b6981b Fixed #18231 -- Made JavaScript i18n not pollute global JS namespace.
Also, use Django templating for the dynamic generated JS code and use
more idiomatic coding techniques.

Thanks Matthew Tretter for the report and the patch.
2013-04-14 17:45:01 -03:00
Claude Paroz ddfc68379f Changed a deprecated warn() call in libgeos 2013-04-11 11:01:17 +02:00
Jannis Leidel ed576b69f9 Merge pull request #938 from darklow/ticket_20111
Added more precise message level for succcess and warning messages
2013-04-08 04:56:57 -07:00
Kaspars Sprogis 3be368c73e Fix #20111 Added more precise message level for succcess and warning messages 2013-04-08 14:54:03 +03:00
Andrew Jesaitis 5ab66dea50 Explicitly removes dismissCalendar
Uses the removeEvent function in core.js to remove the dismissCalendar
function from the document click event.
Fixes #4045.
2013-04-06 13:50:09 +02:00
Andrew Jesaitis 4509a1be1f Explicitly removes dismissClock
Uses the removeEvent function in core.js to remove the function from
the document click event.
Refs #4045.
2013-04-06 13:50:09 +02:00
Preston Holmes a49e7dd2a3 Fixed #20114 -- support custom project login_url in tests
Thanks to Matias Bordese for the patch
2013-04-05 09:03:28 -07:00
Carl Meyer 7ccbe6a4fa Fix contrib.messages tests for discovery. 2013-04-03 15:30:34 -06:00
Preston Timmons fde2e4fd6e Modified auth to work with unittest2 discovery. 2013-04-02 21:59:45 -06:00
Preston Timmons e3cfbaaca4 Modified sitemaps to work with unittest2 discovery. 2013-04-02 20:12:35 -06:00
Preston Timmons 629d704d5f Modified messages to work with unittest2 discovery. 2013-04-02 20:12:30 -06:00
Preston Timmons 756a70b48d Modified formtools to work with unittest2 discovery. 2013-04-02 20:12:26 -06:00
Preston Timmons 8aedde0385 Updated flatpages tests for unittest2 discovery. 2013-04-02 20:12:24 -06:00
Preston Timmons 7fd1571b2e Modified admindocs tests to work with unittest2 discovery. 2013-04-02 20:12:15 -06:00
Alisson 80b658f5aa Remove unnecessary if conditions
if obj it None, it's None, there's no need to check it
2013-03-30 12:22:28 +01:00
matiasb 86aaff75d0 Fixed #20059 -- Updated humanize tests to force 'en' language setting. 2013-03-30 12:19:39 +01:00
Gavin Wahl ec04fd1344 Fixed spelling errors 2013-03-28 11:16:53 -06:00
Rocky Meza 26ad3abadf Fixed spelling of "consistent" in admin/options.py 2013-03-28 09:10:13 -06:00
Claude Paroz 244e765a94 Updated translation templates 2013-03-28 10:06:11 +01:00
Claude Paroz 0a22f7aad2 Added Burmese language
Thanks to Yhal Htet Aung for the translation work.
2013-03-28 10:01:30 +01:00
Claude Paroz ab76467d54 Added Ossetic language
Thanks to Xwybylty Soslan for the translation work.
2013-03-28 09:54:16 +01:00
Claude Paroz c5084e7557 Updated translations from Transifex
Polish, Telugu, Georgian, Azerbaijani, Norwegian Bokmål, Basque,
Dutch, Thai, Spanish (Argentina), Afrikaans.
2013-03-28 09:24:07 +01:00
Jacob Kaplan-Moss 9e462f8101 Fixed #20078: don't allow filtering on password in the user admin. 2013-03-27 11:24:36 -05:00
Donald Stufft 25f2acfed0 Fixed #20138 -- Added BCryptSHA256PasswordHasher
BCryptSHA256PasswordHasher pre-hashes the users password using
SHA256 to prevent the 72 byte truncation inherient in the BCrypt
algorithm.
2013-03-26 13:26:57 -04:00
Adam Wentz a4b8a4b632 Fixed #20121 -- Removed LogEntry.get_admin_url's hard-coded path.
Updated LogEntry.get_admin_url to use 'reverse' instead
of a hard-coded path.
2013-03-25 23:45:27 -04:00
Andrew Jesaitis d9b12ecbe6 Moved removeChildren to core.js
The function removeChildren is a general utility that other functions
might want to use.
Fixes #4120. Thanks arvin for the initial patch.
2013-03-25 09:38:34 +01:00
Andrew Jesaitis 0a9ea56056 Moved cancelEventPropagation into core.js
The cancelEventPropagation function is a general utility function that
can be reused by other widgets. Refs #4120.
2013-03-25 09:32:12 +01:00
Andrew Jesaitis d5824ef69d Removed quickElement from calendar.js
The function quickElement in calendar.js is a duplicate of the
quickElement function in core.js. Refs #4120.
2013-03-25 09:32:02 +01:00
Simon Charette 151938ddb5 Merge pull request #946 from matiasb/minor-flatpage-translation-fix
Fixed #20117 -- Added missing translation override to fix flatpages test.
2013-03-24 21:08:16 -07:00
Anssi Kääriäinen 97774429ae Fixed #19385 again, now with real code changes
The commit of 266de5f9ae included only
tests, this time also code changes included...
2013-03-24 18:40:40 +02:00
Aymeric Augustin e16c48e001 Fixed #15124 -- Changed the default for BooleanField.
Thanks to the many contributors who updated and improved the patch over
the life of this ticket.
2013-03-24 13:47:01 +01:00
matiasb 6985f0c09b Fixed #20117 -- Added missing translation override to fix flatpages test. 2013-03-23 12:22:44 -03:00
Jannis Leidel e7514e4978 Merge pull request #942 from stephrdev/trac-18000
Fixed #18000 -- Moved the code to handle goto requests to an extra WizardView method.
2013-03-23 05:29:28 -07:00
Stephan Jaekel b614c47f8c Added some class attributes to pass initial form lists to the WizardView without the need to add them in the as_view call. 2013-03-23 12:24:34 +01:00
Stephan Jaekel 46246c6624 Moved the code to handle goto requests in a extra WizardView method. 2013-03-23 12:02:23 +01:00
Russell Keith-Magee 930af661ab Fixed #20048, #20060 -- Modified tests for contrib apps sensitive to custom User models.
Thanks to matiasb for the report of #20060 and the draft patch for #20048.
2013-03-23 09:57:48 +08:00
Aymeric Augustin f7d945e325 Fixed #16350 -- Forced capitalization in template.
This improves rendering in some foreign languages.
2013-03-22 22:41:13 +01:00
Andrew Gorcester f9ab543720 Fixed #20084 -- Provided option to validate formset max_num on server.
This is provided as a new "validate_max" formset_factory option defaulting to
False, since the non-validating behavior of max_num is longstanding, and there
is certainly code relying on it. (In fact, even the Django admin relies on it
for the case where there are more existing inlines than the given max_num). It
may be that at some point we want to deprecate validate_max=False and
eventually remove the option, but this commit takes no steps in that direction.

This also fixes the DoS-prevention absolute_max enforcement so that it causes a
form validation error rather than an IndexError, and ensures that absolute_max
is always 1000 more than max_num, to prevent surprising changes in behavior
with max_num close to absolute_max.

Lastly, this commit fixes the previous inconsistency between a regular formset
and a model formset in the precedence of max_num and initial data. Previously
in a regular formset, if the provided initial data was longer than max_num, it
was truncated; in a model formset, all initial forms would be displayed
regardless of max_num. Now regular formsets are the same as model formsets; all
initial forms are displayed, even if more than max_num. (But if validate_max is
True, submitting these forms will result in a "too many forms" validation
error!) This combination of behaviors was chosen to keep the max_num validation
simple and consistent, and avoid silent data loss due to truncation of initial
data.

Thanks to Preston for discussion of the design choices.
2013-03-21 01:27:24 -07:00
Florian Apolloner a45d06ca3d Fixed #19972 -- Fixed overflow issue in admin changelist pages.
Thanks to loic84 for the report and patch.
2013-03-20 17:00:25 +01:00
Paul Collins 9a85ad89c2 Fixed #16319 -- added SuccessMessageMixin to contrib.messages
Thanks martinogden for the initial patch and d1ffuz0r for tests.
2013-03-19 21:02:55 -07:00
Preston Holmes 7a3409fc64 Merge pull request #931 from catalanojuan/fix-admin-log-dependency-on-user-id-field-20088
Fixed #20088 -- Changed get_admin_log not to depend on User id field
2013-03-19 15:56:01 -07:00
konarkmodi bc4111ba68 Fixed #18003 -- Preserved tracebacks when re-raising errors.
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
2013-03-19 15:42:39 -07:00
Juan Catalano 054ce2aa02 Fixed #20088 -- Changed get_admin_log not to depend on User id field
Before this change, the get_admin_log method would expect User model's
FK to be named `id`. When changing that FK name, admin/index.html
rendering would fail.

This includes:
 * Changed the use of id for the use of pk property.
 * Added a regression test that fails without the patch.

This commit refs #20088.
2013-03-19 19:30:43 -03:00
Deric Crago 9d6ecc6bc6 Fixed #19327 -- Added handling of double login attempts in admin.
Thanks to Krzysztof Jurewicz for initial patch and
adupin for tests.
2013-03-18 17:11:07 -07:00
Aymeric Augustin 0df8ff3dbe Fixed #19550 -- Made the filtered select widget wider in the admin.
Thanks Claude and Julien for the review.
2013-03-17 22:48:52 +01:00
Aymeric Augustin 9d4a5b00f1 Stopped using non-standard __globals__ and __code__ attributes.
Some alternative implementations don't have them.

Closes #19944.
2013-03-17 10:44:28 +01:00
Baptiste Mispelon babd1090ee Fix 20061: remove out of date comment. 2013-03-16 18:55:24 +01:00
Baptiste Mispelon 0122a98dad Fixed #20055 -- Add url, email, and number input types to admin CSS. 2013-03-15 18:54:19 -04:00
Claude Paroz 18e990fa96 Fixed #16110 -- Fixed GeometryField odd behaviour regarding null values
Thanks slinkp for the report and the initial patch.
2013-03-15 21:45:33 +01:00
Claude Paroz 2f121dfe63 Fixed #17051 -- Removed some 'invalid' field error messages
When the 'invalid' error message is set at field level, it masks
the error message raised by the validator, if any.
2013-03-14 17:03:43 +01:00
Claude Paroz 747f7d2549 Fixed #20036 -- Improved GEOS version string parsing
Thanks chikiro.spam at gmail.com for the report.
2013-03-13 09:52:33 +01:00
Anssi Kääriäinen d3f00bd570 Refactored qs.add_q() and utils/tree.py
The sql/query.py add_q method did a lot of where/having tree hacking to
get complex queries to work correctly. The logic was refactored so that
it should be simpler to understand. The new logic should also produce
leaner WHERE conditions.

The changes cascade somewhat, as some other parts of Django (like
add_filter() and WhereNode) expect boolean trees in certain format or
they fail to work. So to fix the add_q() one must fix utils/tree.py,
some things in add_filter(), WhereNode and so on.

This commit also fixed add_filter to see negate clauses up the path.
A query like .exclude(Q(reversefk__in=a_list)) didn't work similarly to
.filter(~Q(reversefk__in=a_list)). The reason for this is that only
the immediate parent negate clauses were seen by add_filter, and thus a
tree like AND: (NOT AND: (AND: condition)) will not be handled
correctly, as there is one intermediary AND node in the tree. The
example tree is generated by .exclude(~Q(reversefk__in=a_list)).

Still, aggregation lost connectors in OR cases, and F() objects and
aggregates in same filter clause caused GROUP BY problems on some
databases.

Fixed #17600, fixed #13198, fixed #17025, fixed #17000, fixed #11293.
2013-03-13 10:44:49 +02:00
Aymeric Augustin 4846e2b744 Removed unused imports.
One of these functions didn't exist anymore.
2013-03-12 10:09:04 +01:00
Jacob Kaplan-Moss 571b2d139b Deprecated django.contrib.comments. 2013-03-11 15:38:40 -05:00
Aymeric Augustin f2f98abb95 Avoided closing the database connection within a transaction.
Refs #9437.
2013-03-11 21:08:49 +01:00
Aymeric Augustin 1adb7b3c38 Ported layermapping for autocommit. 2013-03-11 20:03:17 +01:00
Aymeric Augustin 3710a918b2 Switched the admin to use @transaction.atomic. 2013-03-11 19:58:08 +01:00
Aymeric Augustin ba5138b1c0 Deprecated transaction.commit/rollback_unless_managed.
Since "unless managed" now means "if database-level autocommit",
committing or rolling back doesn't have any effect.

Restored transactional integrity in a few places that relied on
automatically-started transactions with a transitory API.
2013-03-11 14:48:54 +01:00
Claude Paroz 360217fc87 Fixed #19171 -- Allowed coordinate transforms with custom SRIDs
Thanks reidpr at lanl.gov for the report.
2013-03-09 17:46:20 +01:00
Claude Paroz e6f5b7eacd Fixed #9806 -- Allowed editing GeometryField with OpenLayersWidget
Thanks Paul Winkler for the initial patch.
2013-03-09 16:10:28 +01:00
Claude Paroz f3d1aebed1 Reformatted slightly openlayers.js 2013-03-09 15:08:16 +01:00
Claude Paroz 5e80571bf9 Fixed #16594 -- Added wkt 3D support for GEOS geometries
This requires GEOS >= 3.3.0 to function properly. On previous
versions, the Z dimension will simply not appear in the wkt.
Disabled OpenLayers editing for 3D geometries (unsupported).
2013-03-09 12:02:22 +01:00
Claude Paroz 8a92139d8a Replaced proj4 testing by a regex 2013-03-08 22:52:41 +01:00
Loic Bistuer 6983a1a540 Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that return a QuerySet. 2013-03-08 10:11:45 -05:00
Baptiste Mispelon 81804ae474 Fix 19916. Smarter tokenizing of contrib.comment's templatetags arguments. 2013-03-07 19:30:38 +01:00
Igor Támara e2ee02c5bd Fixed #19951 -- Admin: Invalid model PK values shouldn't cause 500 status.
Avoid ValueError in admin when passing a string as PK for an inherited
model with an integer PK field.

Thanks ikks for the patch. See also #11191.
2013-03-06 21:38:44 -03:00
Juan Pedro Fisanotti d9330d5be2 Fixed #6585 -- Admin relationship widgets: Respect ordering defined by target model's ModelAdmin.
Thanks Gary Wilson for the report and Juan Pedro Fisanotti, Carlos
Matías de la Torre for the fix.
2013-03-04 18:08:53 -03:00
Javier Mansilla 3ea0c7d35a Fixed #19838 -- Admin: Don't leak a 500 HTTP status when trying to delete protected FKs.
Thanks rafadev for the report and Javier Mansilla for the fix.
2013-03-04 13:30:59 -03:00
Ramiro Morales 03e40140ff Merge pull request #871 from matiasb/ticket_19945
Fixed #19945 -- Fixed default User model Meta inheritance.
2013-03-03 14:30:36 -08:00
Ramiro Morales 3bbcec0aba Removed mentions of regressiontests. 2013-03-03 17:03:11 -03:00
Pedro Mourelle 0868e5a8ac Fixed #19177 -- Better layout for admin login form field labels.
Thanks goes to void for the comprehensive report, to Pedro Mourelle for
the fix and to Bryan Veloso, Łukasz Rekucki and Claude Paroz for the
review.

This fix includes the following changes:

* Modified layout to top-aligned labels.
* Added 'air' for inputs (the padding was really needed there.). It
  adjust good to zoom in/out.
* Removed float attributes from label and inputs in login form.
* Removed useless text-align property.
2013-03-02 20:27:59 -03:00
Claude Paroz 8e8c9b908a Fixed getting default encoding in get_system_username
Refs #19933.
2013-03-02 22:41:08 +01:00
matiasb f39fead1c3 Fixed #19945 -- Fixed default User model Meta inheritance.
Updated default User model Meta class to extend AbstractUser Meta
where translated verbose_name and verbose_name_plural are
defined.
2013-03-01 19:32:20 -03:00
Aymeric Augustin 2ee21d9f0d Implemented persistent database connections.
Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
2013-02-28 15:28:13 +01:00
Claude Paroz 87cc3da814 Merged contrib translations from 1.5 branch 2013-02-26 21:51:06 +01:00
Aymeric Augustin f1255a3c09 Fixed #18144 -- Restored compatibility with SHA1 hashes with empty salt.
Thanks dahool for the report and initial version of the patch.
2013-02-25 20:21:58 +01:00
Carl Meyer 906dc8522a Fixed #19854 -- Turn Django's own Selenium tests off by default. 2013-02-25 10:14:42 -07:00
Florian Apolloner b88bf9f125 Fixed python 3 support. Refs #17320 2013-02-24 18:35:08 +01:00
Aymeric Augustin e3e0f49ece Merge pull request #834 from vdboor/issue_19906_list_classes
Added column-<field_name> classes to the admin list
2013-02-24 08:58:57 -08:00
Diederik van der Boor b7ba4fc408 Add column-<field_name> classes to the admin list
This simplifies CSS styling to set column widths.
2013-02-24 17:50:23 +01:00
Florian Apolloner 5e52dc2ade Merge pull request #828 from zerok/tickets/17320
Fixed #17320 -- Added whitespace validation to Site.domain field
2013-02-24 08:39:27 -08:00
Horst Gutmann c729461479 Fixed #17320 -- Added whitespace validation to the Site.domain field 2013-02-24 16:40:51 +01:00
Zbigniew Siciarz 0a8402eb05 Test case and docs for custom context data in feeds
Thanks Paul Winkler for the initial patch. (Ref #18112).
2013-02-24 08:33:20 -06:00
Aymeric Augustin bc787f6a32 Loaded cycle and firstof from future in built-in templates. Refs #17906.
This was missing from f49e9a517f.
2013-02-24 15:16:45 +01:00
Joeri Bekker b9cc61021a Fixed #9084 - Best approach for an OS to atomically rename the session file. 2013-02-24 14:21:40 +01:00
Aymeric Augustin 7106a1e594 Merge pull request #819 from erikr/master
Fixed #16302 -- Ensured contrib.comments is IPv6 capable.
2013-02-24 05:02:00 -08:00
Erik Romijn ade992c61e Fixed #16302 -- Ensure contrib.comments is IPv6 capable
Changed the ip_address field for Comment to GenericIPAddressField. Added
instructions to the release notes on how to update the schema of existing
databases.
2013-02-24 13:58:38 +01:00
Honza Král d7e835f76d Merge pull request #820 from viciu/11295
Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
2013-02-24 04:35:27 -08:00
Aymeric Augustin a44531ae15 Fixed #18862 -- Honored script prefix in FlatPage.get_absolute_url. 2013-02-24 13:27:13 +01:00
Aymeric Augustin 4b01ee7a50 URL-encoded URLs in FlatPage.get_absolute_url. 2013-02-24 13:27:13 +01:00
Wiktor Kolodziej f07a5f0a21 Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
Original patch rewritten, added tests and get_filters_params method for ChangeList class.
Thanks Alex for the report.
2013-02-24 13:23:23 +01:00
Florian Apolloner f56ca3f0e6 Fixed the usage of the deprecated assertEquals. 2013-02-24 11:15:17 +01:00
Preston Holmes 22d82a7742 Fixed #15198 -- pass request to AuthenticationForm
Thanks to Ciantic for the report, claudep and slurms for initial work
2013-02-23 15:28:49 -08:00
Preston Holmes 9d2c0a0ae6 Removed superfluous cookie check from auth login.
This is ensured through the CSRF protection of the view
2013-02-23 15:28:49 -08:00
Honza Král 692902b227 Merge pull request #778 from viciu/19609
Fixed #19609: admin Inlines doesn't display help_text for readonly fields
2013-02-23 14:34:57 -08:00
Honza Kral 2b48fcc607 Fixed #18491 -- deleting a proxy doesn't show warning about cascade deletes 2013-02-23 23:20:34 +01:00
Aleksandra Sendecka 32a7ab2148 Fixed #19526
CSS specifications governs that syntax is case insensitive.
This modifies CachedFilesMixin to support that.
2013-02-23 23:05:22 +01:00
Hernan Lozano 7e6ad76b24 Fixed #19282 -- Restored ability to pass Decimals to intcomma filter 2013-02-23 21:48:22 +01:00
Claude Paroz 98ab8e8876 Fixed #19698 -- Cleared sites cache with signals
Thanks ddavies at nomensa.com for the report and the patch and
serdaroncode for reviewing the patch.
2013-02-23 19:31:17 +01:00
Wiktor Kolodziej 67dd54dc84 Fixed #19609: admin Inlines doesn't display help_text for readonly fields
Refactoring: field was renamed to field_name, since flatten_fieldsets returns field name, not field.

Original patch from Marc Aymerich Gubern
2013-02-23 18:24:32 +01:00
Zbigniew Siciarz 1cd2f51eb4 Added test runner option to skip Selenium tests (#19854). 2013-02-23 17:45:26 +01:00
Mathijs de Bruin 8c1cc4b3b0 Fixed regression introduced in 146ed13a.
As override_settings was used after the initialization of the session backend,
we need to use a new session backend here.
2013-02-23 16:53:31 +01:00
Jannis Leidel 6bbf4e57c8 Fixed embarrassing typo in last commit. 2013-02-23 14:59:51 +01:00
fako 2db9cbe97c Removes document_root argument from django.contrib.staticfiles.views.serve
This argument can be removed, because the new way of finding static files doesn't take document_root into account at all.
2013-02-23 14:38:13 +01:00
Jannis Leidel c12891e8cd Fixed #19850 -- Use configured staticfiles storage to find the URL of a static file in the admin. 2013-02-23 14:36:51 +01:00
Horst Gutmann 2f4a4703e1 Fixed #19758 -- Avoided leaking email existence through the password reset form. 2013-02-23 14:31:21 +01:00
Anssi Kääriäinen 50677b29af Made a couple of selenium tests wait for page loaded
The admin_widgets tests were issuing click() to the browser but
didn't wait for the effects of those clicks. This caused the resulting
request to be processed concurrently with the test case. When using
in-memory SQLite this caused weird failures.

Also added wait_page_loaded() to admin selenium tests for code
reuse.

Fixed #19856
2013-02-20 23:56:57 +02:00
Claude Paroz cb5545ea2d Fixed #19598 -- Fixed jQuery tagName retrieving
Thanks rj at rudiculous.net for the report.
2013-02-20 14:16:00 +01:00
Claude Paroz 4246fe6006 Replaced the obsolete toggle event handling JS function
The toggle(func1, func2) event handling function has been removed
in jQuery 1.9.
2013-02-20 13:54:59 +01:00
Claude Paroz 8bbca211b6 Fixed #14571 -- Updated embedded jQuery from 1.4.2 to 1.9.1
Thanks dArignac for the initial patch.
2013-02-20 13:52:15 +01:00
Carl Meyer 1f39eafd60 Checked object permissions on admin history view.
This is a security fix. Disclosure and advisory coming shortly.

Patch by Russell Keith-Magee.
2013-02-19 11:23:30 -07:00
Carl Meyer d51fb74360 Added a new required ALLOWED_HOSTS setting for HTTP host header validation.
This is a security fix; disclosure and advisory coming shortly.
2013-02-19 11:23:29 -07:00
Claude Paroz 5ec0405a09 Fixed #19839 -- Isolated auth tests from customized TEMPLATE_LOADERS
Thanks limscoder for the report.
2013-02-18 09:22:25 +01:00
Aymeric Augustin e74e207cce Fixed #17260 -- Added time zone aware aggregation and lookups.
Thanks Carl Meyer for the review.

Squashed commit of the following:

commit 4f290bdb60
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 21:21:30 2013 +0100

    Used '0:00' instead of 'UTC' which doesn't always exist in Oracle.

    Thanks Ian Kelly for the suggestion.

commit 01b6366f3c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 13:38:43 2013 +0100

    Made tzname a parameter of datetime_extract/trunc_sql.

    This is required to work around a bug in Oracle.

commit 924a144ef8
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 13 14:47:44 2013 +0100

    Added support for parameters in SELECT clauses.

commit b4351d2890
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 22:30:22 2013 +0100

    Documented backwards incompatibilities in the two previous commits.

commit 91ef84713c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:42:31 2013 +0100

    Used QuerySet.datetimes for the admin's date_hierarchy.

commit 0d0de288a5
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 09:29:38 2013 +0100

    Used QuerySet.datetimes in date-based generic views.

commit 9c0859ff7c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:25 2013 +0100

    Implemented QuerySet.datetimes on Oracle.

commit 68ab511a4f
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:14 2013 +0100

    Implemented QuerySet.datetimes on MySQL.

commit 22d52681d3
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:42:29 2013 +0100

    Implemented QuerySet.datetimes on SQLite.

commit f6800fd04c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:43:03 2013 +0100

    Implemented QuerySet.datetimes on PostgreSQL.

commit 0c829c23f4
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:41:08 2013 +0100

    Added datetime-handling infrastructure in the ORM layers.

commit 104d82a777
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Mon Feb 11 10:05:55 2013 +0100

    Updated null_queries tests to avoid clashing with the __second lookup.

commit c01bbb3235
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 23:07:41 2013 +0100

    Updated tests of .dates().

    Replaced .dates() by .datetimes() for DateTimeFields.
    Replaced dates with datetimes in the expected output for DateFields.

commit 50fb7a5246
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 21:40:09 2013 +0100

    Updated and added tests for QuerySet.datetimes.

commit a8451a5004
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 22:34:46 2013 +0100

    Documented the new time lookups and updated the date lookups.

commit 29413eab2b
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Sun Feb 10 16:15:49 2013 +0100

    Documented QuerySet.datetimes and updated QuerySet.dates.
2013-02-16 09:19:04 +01:00
Claude Paroz 87854b0bdf Fixed geos test to prevent random failure
Points in the test fixtures have 20 as max coordinate.
2013-02-15 20:13:36 +01:00
Claude Paroz 35185495e3 Fixed #17066 -- Prevented TypeError in GeoIP.__del__
When garbaging GeoIP instances, it happens that GeoIP_delete is
already None.
Thanks mitar for the report and stefanw for tests.
2013-02-15 17:12:14 +01:00
Claude Paroz a8d1421dd9 Avoided unneeded assertion on Python 3
Fixes failure introduced in 02e5909f7a.
2013-02-15 16:09:31 +01:00
Claude Paroz 02e5909f7a Fixed #19807 -- Sanitized getpass input in createsuperuser
Python 2 getpass on Windows doesn't accept unicode, even when
containing only ascii chars.
Thanks Semmel for the report and tests.
2013-02-15 15:44:27 +01:00
Russell Keith-Magee f5e4a699ca Fixed #19822 -- Added validation for uniqueness on USERNAME_FIELD on custom User models.
Thanks to Claude Peroz for the draft patch.
2013-02-15 09:00:55 +08:00
Claude Paroz f1029b308f Fixed a misnamed variable introduced in commit 142ec8b283
Refs #8404.
2013-02-14 08:33:10 +01:00