Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed #885, but broke tons of other tests....

  • Loading branch information...
commit 54b2815f52d8fa9e6642fa06f4b87b4f4404f35f 1 parent 234f773
@ojii authored
Showing with 13 additions and 10 deletions.
  1. +4 −1 cms/signals.py
  2. +9 −9 cms/utils/page_resolver.py
View
5 cms/signals.py
@@ -67,7 +67,10 @@ def pre_save_title(instance, raw, **kwargs):
parent_page = instance.page.parent
slug = u'%s' % instance.slug
- instance.path = u'%s' % slug
+ if instance.page.is_home():
+ instance.path = ''
+ else:
+ instance.path = u'%s' % slug
if parent_page:
parent_title = Title.objects.get_title(parent_page, language=instance.language, language_fallback=True)
if parent_title:
View
18 cms/utils/page_resolver.py
@@ -65,15 +65,15 @@ def get_page_from_path(path, preview=False):
q = Q(title_set__slug=path)
else:
q = Q(title_set__path=path)
- if home:
- # if we have a home, also search for all paths prefixed with the
- # home slug that are on the same tree as home, since home isn't ussually
- # called with it's slug, thus it's children don't have the home bit in
- # the request either, thus we need to re-add it.
- q2 = Q()
- q2 = Q(title_set__path='%s/%s' % (home.get_slug(), path))
- q2 &= Q(tree_id=home.tree_id)
- q |= q2
+# if home:
+# # if we have a home, also search for all paths prefixed with the
+# # home slug that are on the same tree as home, since home isn't ussually
+# # called with it's slug, thus it's children don't have the home bit in
+# # the request either, thus we need to re-add it.
+# q2 = Q()
+# q2 = Q(title_set__path='%s/%s' % (home.get_slug(), path))
+# q2 &= Q(tree_id=home.tree_id)
+# q |= q2
try:
page = pages.filter(q).distinct().get()
except Page.DoesNotExist:
Please sign in to comment.
Something went wrong with that request. Please try again.