Commit 3c06b2f2 authored by Preston Timmons's avatar Preston Timmons Committed by Tim Graham
Browse files

Fixed #22486 -- Restored the ability to reverse views created using functools.partial.

Regression in 8b93b314.

Thanks rcoup for the report.
parent c3152e5b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ a string) and returns a tuple in this format:
"""
from __future__ import unicode_literals

import functools
from importlib import import_module
import re
from threading import local
@@ -270,6 +271,9 @@ class RegexURLResolver(LocaleRegexProvider):
                self._callback_strs.add(pattern._callback_str)
            elif hasattr(pattern, '_callback'):
                callback = pattern._callback
                if isinstance(callback, functools.partial):
                    callback = callback.func

                if not hasattr(callback, '__name__'):
                    lookup_str = callback.__module__ + "." + callback.__class__.__name__
                else:
+14 −0
Original line number Diff line number Diff line
===========================
Django 1.4.12 release notes
===========================

*Under development*

Django 1.4.12 fixes a regression in the 1.4.11 security release.

Bugfixes
========

* Restored the ability to :meth:`~django.core.urlresolvers.reverse` views
  created using :func:`functools.partial()`
  (`#22486 <http://code.djangoproject.com/ticket/22486>`_)
+14 −0
Original line number Diff line number Diff line
==========================
Django 1.5.7 release notes
==========================

*Under development*

Django 1.5.7 fixes a regression in the 1.5.6 security release.

Bugfixes
========

* Restored the ability to :meth:`~django.core.urlresolvers.reverse` views
  created using :func:`functools.partial()`
  (`#22486 <http://code.djangoproject.com/ticket/22486>`_)
+4 −0
Original line number Diff line number Diff line
@@ -12,3 +12,7 @@ Bugfixes
* Added backwards compatibility support for the :mod:`django.contrib.messages`
  cookie format of Django 1.4 and earlier to facilitate upgrading to 1.6 from
  1.4 (`#22426 <http://code.djangoproject.com/ticket/22426>`_).

* Restored the ability to :meth:`~django.core.urlresolvers.reverse` views
  created using :func:`functools.partial()`
  (`#22486 <http://code.djangoproject.com/ticket/22486>`_)
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ Final releases
.. toctree::
   :maxdepth: 1

   1.5.7
   1.5.6
   1.5.5
   1.5.4
@@ -60,6 +61,7 @@ Final releases
.. toctree::
   :maxdepth: 1

   1.4.12
   1.4.11
   1.4.10
   1.4.9
Loading