Revision 06c456e2 cloudcmsblog/views.py

b/cloudcmsblog/views.py
38 38
from django.shortcuts import get_object_or_404
39 39

  
40 40
from cloudcms.models import Application
41
from cloudcmsblog.models import Entry, Category, CategoryTranslation
41
from cloudcmsblog.models import Entry, Category, CategoryTranslation, get_blog_page
42 42

  
43 43
def index(request):
44 44
    """
......
47 47
    categories = Category.objects.filter(display_on_menu=True)
48 48
    if categories.exists() == 0:
49 49
        raise Http404
50
    
51
    app_page_url = get_blog_page().get_navigation_url()
52
    try:
53
        default_category_url = categories[0].get_absolute_url()
54
    except IndexError:
55
        raise Http404
50 56

  
51
    return HttpResponseRedirect(categories[0].get_absolute_url())
57
    return HttpResponseRedirect("%s%s" % (app_page_url.rstrip("/"), default_category_url))
52 58

  
53 59

  
54 60
def archive(request, category):

Also available in: Unified diff