Skip to content

Instantly share code, notes, and snippets.

@beniwohli
Created January 21, 2010 17:22
Show Gist options
  • Save beniwohli/282962 to your computer and use it in GitHub Desktop.
Save beniwohli/282962 to your computer and use it in GitHub Desktop.
diff --git a/cms/models/__init__.py b/cms/models/__init__.py
index bca24e6..557e1cf 100644
--- a/cms/models/__init__.py
+++ b/cms/models/__init__.py
@@ -35,7 +35,7 @@ def monkeypatch_reverse():
url = ''
i18n = 'cms.middleware.multilingual.MultilingualURLMiddleware' in settings.MIDDLEWARE_CLASSES
lang = None
- if viewname.split(":")[0] in dict(settings.LANGUAGES).keys():
+ if isinstance(viewname, basestring) and viewname.split(":")[0] in dict(settings.LANGUAGES).keys():
lang = viewname.split(":")[0]
try:
url = django.core.urlresolvers.old_reverse(viewname, urlconf=urlconf, args=args, kwargs=kwargs, prefix=prefix, current_app=current_app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment