Ticket #6892: 6892v2.diff

File 6892v2.diff, 736 bytes (added by daonb <bennydaon@…>, 16 years ago)

A documentation patch

  • views/generic/simple.py

     
    3333    If the given url is ``None``, a HttpResponseGone (410) will be issued.
    3434    """
    3535    if url is not None:
    36         return HttpResponsePermanentRedirect(url % kwargs)
     36        try:
     37                return HttpResponsePermanentRedirect(url % kwargs)
     38        except ValueError:
     39                raise ValueError('URL formatting failed in django.views.simple.redirect_to. This can result from the url parameters containing any %-encoded characters. To solve it, replace all "%" with "%%".')
     40               
    3741    else:
    3842        return HttpResponseGone()
Back to Top