~zulcss/horizon/horizon-g3-precise

« back to all changes in this revision

Viewing changes to horizon/views/auth.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-06-01 10:57:56 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120601105756-dif0km7n98vhdi2x
Tags: 2012.2~f2~20120530.1777-0ubuntu1
* New upstream release. 
* debian/patches/add_juju_settings_panel.patch: Refreshed
* debian/patches/turn-off-debug.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from django import shortcuts
24
24
from django.conf import settings
25
25
from django.contrib.auth import REDIRECT_FIELD_NAME
 
26
from django.utils.decorators import method_decorator
26
27
from django.utils.translation import ugettext as _
 
28
from django.views.decorators.debug import sensitive_post_parameters
27
29
 
28
30
import horizon
29
31
from horizon import api
50
52
    form_class = Login
51
53
    template_name = "horizon/auth/login.html"
52
54
 
 
55
    @method_decorator(sensitive_post_parameters('password'))
 
56
    def dispatch(self, *args, **kwargs):
 
57
        return super(LoginView, self).dispatch(*args, **kwargs)
 
58
 
53
59
    def get_context_data(self, **kwargs):
54
60
        context = super(LoginView, self).get_context_data(**kwargs)
55
61
        redirect_to = self.request.REQUEST.get(REDIRECT_FIELD_NAME, "")
67
73
        return initial
68
74
 
69
75
 
 
76
@sensitive_post_parameters("password")
70
77
def switch_tenants(request, tenant_id):
71
78
    """
72
79
    Swaps a user from one tenant to another using the unscoped token from