~deeptik/linaro-ci-dashboard/django-openid-changes

« back to all changes in this revision

Viewing changes to dashboard/frontend/views/index_view.py

  • Committer: Deepti B. Kalakeri
  • Date: 2012-07-05 15:23:51 UTC
  • Revision ID: deepti.kalakeri@linaro.org-20120705152351-ann5102ksqtfv59x
Using the login_required decorator to for openid login

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from django.http import HttpResponse
2
1
from django.views.generic.base import TemplateView
 
2
from django.utils.decorators import method_decorator
3
3
from django.contrib.auth.decorators import login_required
4
4
 
5
5
class IndexView(TemplateView):
6
6
 
7
7
    template_name = "index.html"
8
8
     
 
9
    @method_decorator(login_required)
 
10
    def dispatch(self, *args, **kwargs):
 
11
        return super(IndexView, self).dispatch(*args, **kwargs)
 
12
 
9
13
    def get_context_data(self, **kwargs):
10
14
        context = super(IndexView, self).get_context_data(**kwargs)
11
15
        context['request'] = self.request