Commits

Anonymous committed 53b53b9

Updated monkey-patch of the urlresolvers.reverse function for Django 1.1.
Thanks Akimov, Tomas and Robin.

Comments (0)

Files changed (1)

localeurl/models.py

 from localeurl import utils
 
 if localeurl.settings.URL_TYPE == 'path_prefix' and settings.USE_I18N:
-    def reverse(viewname, urlconf=None, args=[], kwargs={}, prefix=None):
-        locale = utils.supported_language(kwargs.pop('locale',
+    def reverse(*args, **kwargs):
+        reverse_kwargs = kwargs.get('kwargs', {})
+        locale = utils.supported_language(reverse_kwargs.pop('locale',
                 translation.get_language()))
-        path = django_reverse(viewname, urlconf, args, kwargs, prefix)
+        path = django_reverse(*args, **kwargs)
         return utils.locale_url(path, locale)
 
     django_reverse = urlresolvers.reverse