Permalink
Browse files

bth: temp view

  • Loading branch information...
1 parent 889c175 commit 9cb9d0f951ac47a7f3396a9d74d14d1fde0f8e18 @benthuffine committed Nov 30, 2011
Showing with 8 additions and 8 deletions.
  1. +8 −8 apps/content/views.py
View
@@ -57,15 +57,15 @@ def page_detail(request, item, recent_entries, slug):
def newsevent_list(request):
slug = 'news-and-events'
- contentpage = get_object_or_404(Page, slug__exact=slug)
+ contentpage = get_object_or_404(Page, slug__exact=slug, approved=True)
events_list = NewsEvent.objects.filter(start_date__lte=datetime.now(), end_date__gte=datetime.now(), approved=True).order_by('start_date', 'event_start_date')
context = page_list(request, contentpage, events_list, slug)
return render_to_response('content/newsevent_list.html', {}, context_instance=context)
def newsevent_detail(request, slug):
- event = get_object_or_404(NewsEvent, slug__exact=slug, approved=True)
+ event = get_object_or_404(NewsEvent, slug__exact=slug)
if event.start_date >= datetime.now().date() or event.end_date <= datetime.now().date():
raise Http404('Page Not Found')
@@ -77,15 +77,15 @@ def newsevent_detail(request, slug):
def about_list(request):
slug = 'about'
- contentpage = get_object_or_404(Page, slug__exact=slug)
+ contentpage = get_object_or_404(Page, slug__exact=slug, approved=True)
about_list = AboutPage.objects.filter(approved=True).order_by('sort_order')
context = page_list(request, contentpage, about_list, slug)
return render_to_response('content/about_list.html', {}, context_instance=context)
def about_detail(request, slug):
- about = get_object_or_404(AboutPage, slug__exact=slug, approved=True)
+ about = get_object_or_404(AboutPage, slug__exact=slug)
recent_entries = AboutPage.objects.filter(approved=True).order_by('sort_order')[:6]
context = page_detail(request, about, recent_entries, 'about')
@@ -94,15 +94,15 @@ def about_detail(request, slug):
def resource_list(request):
slug = 'resources'
- contentpage = get_object_or_404(Page, slug__exact=slug)
+ contentpage = get_object_or_404(Page, slug__exact=slug, approved=True)
resource_list = ResourcePage.objects.filter(approved=True).order_by('sort_order')
context = page_list(request, contentpage, resource_list, slug)
return render_to_response('content/resource_list.html', {}, context_instance=context)
def resource_detail(request, slug):
- resource = get_object_or_404(ResourcePage, slug__exact=slug, approved=True)
+ resource = get_object_or_404(ResourcePage, slug__exact=slug)
recent_entries = ResourcePage.objects.filter(approved=True).order_by('sort_order')[:6]
context = page_detail(request, resource, recent_entries, 'resources')
@@ -111,15 +111,15 @@ def resource_detail(request, slug):
def community_association_list(request):
slug = 'community-association'
- contentpage = get_object_or_404(Page, slug__exact=slug)
+ contentpage = get_object_or_404(Page, slug__exact=slug, approved=True)
community_association_list = CommunityAssocationPage.objects.filter(approved=True).order_by('sort_order')
context = page_list(request, contentpage, community_association_list, slug)
return render_to_response('content/community_association_list.html', {}, context_instance=context)
def community_association_detail(request, slug):
- community_association_page = get_object_or_404(CommunityAssocationPage, slug__exact=slug, approved=True)
+ community_association_page = get_object_or_404(CommunityAssocationPage, slug__exact=slug)
recent_entries = CommunityAssocationPage.objects.filter(approved=True).order_by('sort_order')[:6]
context = page_detail(request, community_association_page, recent_entries, 'community-association')

0 comments on commit 9cb9d0f

Please sign in to comment.