Commits

Anonymous committed 22f96e5

Handle situation when kwargs is None

Comments (0)

Files changed (1)

localeurl/models.py

 
 def reverse(*args, **kwargs):
     reverse_kwargs = kwargs.get('kwargs', {})
-    locale = utils.supported_language(reverse_kwargs.pop('locale',
-            translation.get_language()))
+    if reverse_kwargs!=None:
+        locale = utils.supported_language(reverse_kwargs.pop('locale',
+                translation.get_language()))
+    else:
+        locale = translation.get_language()
     url = django_reverse(*args, **kwargs)
     _, path = utils.strip_script_prefix(url)
     return utils.locale_url(path, locale)