Commits

Carl Meyer committed 2d1a78f Merge

Merge; fixed #18

  • Participants
  • Parent commits 58ffb48, 22f96e5

Comments (0)

Files changed (1)

localeurl/models.py

 from localeurl import utils
 
 def reverse(*args, **kwargs):
-    reverse_kwargs = kwargs.get('kwargs', {})
-    locale = utils.supported_language(reverse_kwargs.pop('locale',
-            translation.get_language()))
+    reverse_kwargs = kwargs.get('kwargs') or {}
+    locale = utils.supported_language(reverse_kwargs.pop(
+            'locale', translation.get_language()))
     url = django_reverse(*args, **kwargs)
     _, path = utils.strip_script_prefix(url)
     return utils.locale_url(path, locale)