summaryrefslogtreecommitdiff
path: root/django/utils
AgeCommit message (Collapse)Author
2015-12-13Fixed #25875 -- Prevented UnicodeDecodeError for Q object reprClaude Paroz
Thanks Ben Kraft for the report, and Simon Charette for the review.
2015-12-12Fixed #20223 -- Added keep_lazy() as a replacement for allow_lazy().Iacopo Spalletti
Thanks to bmispelon and uruz for the initial patch.
2015-12-03Fixed #25761 -- Added __cause__.__traceback__ to reraised exceptions.Raphaël Hertzog
When Django reraises an exception, it sets the __cause__ attribute even in Python 2, mimicking Python's 3 behavior for "raise Foo from Bar". However, Python 3 also ensures that all exceptions have a __traceback__ attribute and thus the "traceback2" Python 2 module (backport of Python 3's "traceback" module) relies on the fact that whenever you have a __cause__ attribute, the recorded exception also has a __traceback__ attribute. This is breaking testtools which is using traceback2 (see https://github.com/testing-cabal/testtools/issues/162). This commit fixes this inconsistency by ensuring that Django sets the __traceback__ attribute on any exception stored in a __cause__ attribute of a reraised exception.
2015-11-28Fixed #25812 -- Restored the ability to use custom formats with the date ↵Gagaro
template filter.
2015-11-24Fixed a settings leak possibility in the date template filter.Florian Apolloner
This is a security fix.
2015-11-19Fixed #25769 -- Updated get_version() release candidate naming for PEP 0440.Tim Graham
2015-11-18Removed redundant termcolors.Tim Graham
Replaced MIGRATE_SUCCESS and MIGRATE_FAILURE with SUCCESS and ERROR.
2015-11-17Fixed #25682 -- Removed bare except clauses.Attila Tovt
2015-11-12Fixed #25743 -- Optimized utils.localize() and localize_input()Jaap Roes
Bail early if the input is a string since that's the most common case.
2015-11-11Fixed #25720 -- Made gettext() return bytestring on Python 2 if input is ↵Marti Raudsepp
bytestring. This is consistent with the behavior of Django 1.7.x and earlier.
2015-11-10Updated six to 1.10.0.Tim Graham
2015-11-09Fixed #6727 -- Made patch_cache_control() patch an empty Cache-Control header.Dwight Gunning
2015-11-07Fixed debug view crash during autumn DST change.Aymeric Augustin
This only happens if USE_TZ = False and pytz is installed (perhaps not the most logical combination, but who am I to jugde?) Refs #23714 which essentially fixed the same problem when USE_TZ = True. Thanks Florian and Carl for insisting until I wrote a complete patch.
2015-11-07Amended comment to remove reference to the no longer used NullHandlerNeal Todd
2015-11-03Fixed #25668 -- Misc spelling errorsVille Skyttä
2015-10-26Fixed #25611 -- Standardized descriptor signatures.Tim Graham
2015-10-22Fixed #25571 -- Fixed boolean evaluation of ungettext_lazyClaude Paroz
2015-10-05Removed SimpleLazyObject workaround for a Python 3 bug.Tim Graham
The workaround added in fe8484efda257e151d9c1ca5151e546c9262bf0f seems unnecessary as the Python bug is fixed in Python 3.4.
2015-10-05Removed obsolete (since Python 2.3) __safe_for_unpickling__ attribute.Tim Graham
2015-10-03Fixed #25389 -- Fixed pickling a SimpleLazyObject wrapping a model.Ben Kraft
Pickling a `SimpleLazyObject` wrapping a model did not work correctly; in particular it did not add the `_django_version` attribute added in 42736ac8. Now it will handle this and other custom `__reduce__` methods correctly.
2015-09-29Fixed #25466 -- Added backwards compatibility aliases for LoaderOrigin and ↵Tim Graham
StringOrigin. Thanks Simon Charette for the DeprecationInstanceCheck class.
2015-09-23Removed RemovedInDjango110Warning.Tim Graham
2015-09-23Refs #23613 -- Removed django.utils.checksums per deprecation timeline.Tim Graham
2015-09-23Refs #23269 -- Removed the removetags template tag and related functions per ↵Tim Graham
deprecation timeline.
2015-09-23Refs #24526 -- Made the django logger handle INFO messages.Tim Graham
Without an explicit 'level', only messages at WARNING or higher are handled. This makes the config consistent with the docs which say, "The django catch-all logger sends all messages at the INFO level or higher to the console."
2015-09-23Fixed #25439 -- Added `SUCCESS` style to termcolor palettesMatt Deacalion Stevens
2015-09-19Refs #13110 -- Fixed mistakes in the new multiple enclosure feed testsUnai Zalakain
2015-09-18Fixed #25269 -- Allowed method_decorator() to accept a list/tuple of decorators.fabrizio ettore messina
2015-09-18Fixed #13110 -- Added support for multiple enclosures in Atom feeds.Unai Zalakain
The ``item_enclosures`` hook returns a list of ``Enclosure`` objects which is then used by the feed builder. If the feed is a RSS feed, an exception is raised as RSS feeds don't allow multiple enclosures per feed item. The ``item_enclosures`` hook defaults to an empty list or, if the ``item_enclosure_url`` hook is defined, to a list with a single ``Enclosure`` built from the ``item_enclosure_url``, ``item_enclosure_length``, and ``item_enclosure_mime_type`` hooks.
2015-09-16Fixed #24496 -- Added CSRF Referer checking against CSRF_COOKIE_DOMAIN.Matt Robenolt
Thanks Seth Gottlieb for help with the documentation and Carl Meyer and Joshua Kehn for reviews.
2015-09-07Fixed #24917 -- Made admindocs display model methods that take arguments.Zan Anderle
2015-09-04Fixed #25297 -- Allowed makemessages to work with {% trans %} tags that use ↵Alexandre Pocquet
template filters.
2015-09-04Refs #25345 -- Updated links to code.google.com.Maxime Lorant
2015-08-31Fixed #25331 -- Removed trailing blank lines in docstrings.Maxime Lorant
2015-08-29Made the autoreloader survive all exceptions.Aymeric Augustin
Refs #24704.
2015-08-29Fixed #24704 -- Made the autoreloader survive SyntaxErrors.Aymeric Augustin
With this change, it's expected to survive anything except errors that make it impossible to import the settings. It's too complex to fallback to a sensible behavior with a broken settings module. Harcoding things about runserver in ManagementUtility.execute is atrocious but it's the only way out of the chicken'n'egg problem: the current implementation of the autoreloader primarily watches imported Python modules -- and then a few other things that were bolted on top of this design -- but we want it to kick in even if the project contains import-time errors and django.setup() fails. At some point we should throw away this code and replace it by an off-the-shelf autoreloader that watches the working directory and re-runs `django-admin runserver` whenever something changes.
2015-08-29Ensured gen_filenames() yields native strings.Aymeric Augustin
This also fixes a test failure on Python 2 when Django is installed in a non-ASCII path. This problem cannot happen on Python 3.
2015-08-29Accounted for error files in the autoreloader.Aymeric Augustin
* When some old files contain errors, the second call to gen_filenames() should return them. * When some new files contain errors, the first call to gen_filenames(only_new=True) should return them.
2015-08-25Fixed #25295 -- Restored 'no active translation' after language overrideClaude Paroz
Thanks David Nelson Adamec for the report and Tim Graham for the review.
2015-08-15Fixed #24935 -- Refactored common conditional GET handling.Denis Cornehl
2015-08-12Fixed #24257 -- Corrected i18n handling of percent signs.Doug Beck
Refactored tests to use a sample project. Updated extraction: * Removed special handling of single percent signs. * When extracting messages from template text, doubled all percent signs so they are not interpreted by gettext as string format flags. All strings extracted by gettext, if containing a percent sign, will now be labeled "#, python-format". Updated translation: * Used "%%" for "%" in template text before calling gettext. * Updated {% trans %} rendering to restore "%" from "%%".
2015-08-08Updated Wikipedia links to use httpsClaude Paroz
2015-08-01Fixed #25146 -- Allowed method_decorator() to decorate classes.Rigel Di Scala
2015-07-17Fixed #16501 -- Added an allow_unicode parameter to SlugField.Edward Henderson
Thanks Flavio Curella and Berker Peksag for the initial patch.
2015-07-13Fixed #25099 -- Cleaned up HttpRequest representations in error reporting.Vlastimil Zíma
2015-07-09Fixed #25093 -- Added utils.datastructures.OrderedSet.__len__()darkryder
2015-07-07Refs #23882 -- Added detection for moved files when using inotify pollingChris Bainbridge
Commit 15f82c7 ("used pyinotify as change detection system when available") introduced a regression where editing a file in vim with default settings (writebackup=auto) no longer causes the dev server to be restarted. On a write, vim moves the monitored file to a backup path and then creates a new file in the original. The new file is not monitored as it has a different inode. Fixed this by also watching for inotify events IN_DELETE_SELF and IN_MOVE_SELF.
2015-06-27Sorted imports in __init__.py files.Tim Graham
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-06-23Fixed #25000 -- Fixed cast to string for lazy objects.Marten Kenbeek
Implemented __str__() to return the string-representation of the proxied object, not the proxy itself, if the lazy object didn't have a string-like object in its resultclasses.