Exemplo n.º 1
0
 def login(self, request, user):
     # nasty hack to get get_user to work in Django
     user.backend = "django.contrib.auth.backends.ModelBackend"
     perform_login(request, user)
Exemplo n.º 2
0
 def login(self, request):
     perform_login(request, self.user)
     if self.cleaned_data["remember"]:
         request.session.set_expiry(60 * 60 * 24 * 7 * 3)
     else:
         request.session.set_expiry(0)