Django

Code

Show
Ignore:
Timestamp:
07/02/08 03:32:55 (6 months ago)
Author:
simon
Message:

newforms-admin: custom URL handling in admin now redirects to add trailing slash if needed - this fixes several bugs that occurred when you navigated to an admin page and omitted the trailing slash.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/contrib/admin/sites.py

    r7737 r7825  
    101101        `url` is the remainder of the URL -- e.g. 'comments/comment/'. 
    102102        """ 
     103        if request.method == 'GET' and not request.path.endswith('/'): 
     104            return http.HttpResponseRedirect(request.path + '/') 
     105         
    103106        # Figure out the admin base URL path and stash it for later use 
    104107        self.root_path = re.sub(re.escape(url) + '$', '', request.path)