Permalink
Browse files

Replaced request.path with request.path_info

- bugfix in PageManger
  • Loading branch information...
mvdwaeter committed Jan 19, 2012
1 parent ca8a43d commit c5d4614d4bab53a29feb1e811ba923f39b809999
Showing with 9 additions and 10 deletions.
  1. +1 −1 fiber/context_processors.py
  2. +2 −3 fiber/managers.py
  3. +6 −6 fiber/middleware.py
@@ -16,7 +16,7 @@ def page_info(request):
"""
if EXCLUDE_URLS:
for exclude_url in EXCLUDE_URLS:
- if re.search(exclude_url, request.path.lstrip('/')):
+ if re.search(exclude_url, url.lstrip('/')):
return context
page = Page.objects.get_by_url(url)
View
@@ -160,8 +160,7 @@ def get_by_url(self, url):
last_url_part = url.rstrip('/').rsplit('/', 1)[-1]
if last_url_part:
- page_candidates = qs.exclude(url__exact='', ) \
- .filter(url__icontains=last_url_part)
+ page_candidates = qs.exclude(url__exact='', ).filter(url__icontains=last_url_part)
# We need all the ancestors of all the candidates. We can do this in
# two queries - one for candidates, one for ancestors:
@@ -181,5 +180,5 @@ def get_by_url(self, url):
# requested URL with reversed `named_url`s.
page_candidates = qs.filter(url__startswith='"', url__endswith='"')
for page in page_candidates:
- if get_named_url_from_quoted_url(p.url) == url:
+ if get_named_url_from_quoted_url(page.url) == url:
return page
View
@@ -40,7 +40,7 @@ def __init__(self):
def process_response(self, request, response):
if self.set_login_session(request, response):
request.session['show_fiber_admin'] = True
- url_without_fiber = request.path.replace('@fiber', '')
+ url_without_fiber = request.path_info.replace('@fiber', '')
querystring_without_fiber = ''
if request.META['QUERY_STRING']:
querystring_without_fiber = request.META['QUERY_STRING'].replace('@fiber', '')
@@ -100,7 +100,7 @@ def set_login_session(self, request, response):
"""
if response['Content-Type'].split(';')[0] not in ('text/html', 'application/xhtml+xml'):
return False
- if not (request.path.endswith('@fiber') or (request.META['QUERY_STRING'] and request.META['QUERY_STRING'].endswith('@fiber'))):
+ if not (request.path_info.endswith('@fiber') or (request.META['QUERY_STRING'] and request.META['QUERY_STRING'].endswith('@fiber'))):
return False
else:
return True
@@ -150,12 +150,12 @@ def show_admin(self, request, response):
return False
if EXCLUDE_URLS:
for exclude_url in EXCLUDE_URLS:
- if re.search(exclude_url, request.path.lstrip('/')):
+ if re.search(exclude_url, request.path_info.lstrip('/')):
return False
return True
def is_django_admin(self, request):
- return re.search(r'^%s' % (reverse('admin:index').lstrip('/')), request.path.lstrip('/'))
+ return re.search(r'^%s' % (reverse('admin:index').lstrip('/')), request.path_info.lstrip('/'))
def get_header_html(self, request):
t = loader.get_template('fiber/header.html')
@@ -172,9 +172,9 @@ def get_header_html(self, request):
def get_logout_url(self, request):
if request.META['QUERY_STRING']:
- return '%s?next=%s?%s' % (reverse('admin:logout'), request.path, request.META['QUERY_STRING'])
+ return '%s?next=%s?%s' % (reverse('admin:logout'), request.path_info, request.META['QUERY_STRING'])
else:
- return '%s?next=%s' % (reverse('admin:logout'), request.path)
+ return '%s?next=%s' % (reverse('admin:logout'), request.path_info)
def get_editor_settings(self):
return import_element(EDITOR)

0 comments on commit c5d4614

Please sign in to comment.