web/lib/django/shortcuts/__init__.py
changeset 29 cc9b7e14412b
parent 0 0d40e90630ef
equal deleted inserted replaced
28:b758351d191f 29:cc9b7e14412b
    47     
    47     
    48     # Next try a reverse URL resolution.
    48     # Next try a reverse URL resolution.
    49     try:
    49     try:
    50         return redirect_class(urlresolvers.reverse(to, args=args, kwargs=kwargs))
    50         return redirect_class(urlresolvers.reverse(to, args=args, kwargs=kwargs))
    51     except urlresolvers.NoReverseMatch:
    51     except urlresolvers.NoReverseMatch:
       
    52         # If this is a callable, re-raise.
       
    53         if callable(to):
       
    54             raise
    52         # If this doesn't "feel" like a URL, re-raise.
    55         # If this doesn't "feel" like a URL, re-raise.
    53         if '/' not in to and '.' not in to:
    56         if '/' not in to and '.' not in to:
    54             raise
    57             raise
    55         
    58         
    56     # Finally, fall back and assume it's a URL
    59     # Finally, fall back and assume it's a URL