Fixed #4044 -- Allowed callable views specifier to mix (i.e. not crash) with

prefix strings in URLConfs. Thanks, Vinay Sajip.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5127 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-04-29 09:41:46 +00:00
parent d9f1a0aaef
commit 1cae38c731
1 changed files with 3 additions and 1 deletions

View File

@ -22,5 +22,7 @@ def url(regex, view, kwargs=None, name=None, prefix=''):
# For include(...) processing. # For include(...) processing.
return RegexURLResolver(regex, view[0], kwargs) return RegexURLResolver(regex, view[0], kwargs)
else: else:
return RegexURLPattern(regex, prefix and (prefix + '.' + view) or view, kwargs, name) if prefix and isinstance(view, basestring):
view = prefix + '.' + view
return RegexURLPattern(regex, view, kwargs, name)