Revision bd9ce789 cloudcmsfaq/views.py

b/cloudcmsfaq/views.py
35 35
from django.conf import settings
36 36
from django.views.generic.simple import direct_to_template
37 37
from django.http import HttpResponseRedirect, Http404
38
from django.shortcuts import get_object_or_404
38 39

  
39 40
from cloudcms.models import Application, Service
40 41
from cloudcmsfaq.models import Question, Category, CategoryTranslation
......
56 57
    """
57 58
    Display detailed question.
58 59
    """
59
    entry = Question.objects.get(slug=slug)
60
    entry = get_object_or_404(Question, slug=slug)
60 61
    services = Service.objects.all()
61
    
62

  
62 63
    return direct_to_template(request,
63 64
            "cloudcmsfaq/detail.html", {'question': entry,
64 65
                                        'services': services })

Also available in: Unified diff