Skip to content

Commit

Permalink
Merge pull request #823 from mrj0/issue-790
Browse files Browse the repository at this point in the history
Exclude blank app hooks for all databases
  • Loading branch information
fivethreeo committed Jun 1, 2011
2 parents a6cf36d + 7036e57 commit a941229
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cms/appresolver.py
Expand Up @@ -177,7 +177,7 @@ def get_app_patterns():
hooked_applications = []

# Loop over all titles with an application hooked to them
for title in title_qs.exclude(application_urls=None).select_related():
for title in title_qs.exclude(application_urls=None).exclude(application_urls='').select_related():
if settings.CMS_FLAT_URLS:
if title.language in home_slugs:
path = title.slug.split(home_slugs[title.language] + "/", 1)[-1]
Expand Down
7 changes: 7 additions & 0 deletions cms/tests/apphooks.py
Expand Up @@ -68,13 +68,20 @@ def test_apphook_on_root(self):
superuser = User.objects.create_superuser('admin', 'admin@admin.com', 'admin')
page = create_page("apphooked-page", "nav_playground.html", "en",
created_by=superuser, published=True, apphook="SampleApp")
blank_page = create_page("not-apphooked-page", "nav_playground.html", "en",
created_by=superuser, published=True, apphook="", slug='blankapp')
english_title = page.title_set.all()[0]
self.assertEquals(english_title.language, 'en')
create_title("de", "aphooked-page-de", page, apphook="SampleApp")
self.assertTrue(page.publish())
self.assertTrue(blank_page.publish())

response = self.client.get(self.get_pages_root())
self.assertTemplateUsed(response, 'sampleapp/home.html')

response = self.client.get('/en/blankapp/')
self.assertTemplateUsed(response, 'nav_playground.html')

apphook_pool.clear()

def test_get_page_for_apphook(self):
Expand Down

0 comments on commit a941229

Please sign in to comment.