Changes between Version 4 and Version 5 of CookBookDualSessionMiddleware


Ignore:
Timestamp:
07/26/2007 07:33:52 AM (8 years ago)
Author:
isuhov@…
Comment:

'clean_data' attribute renamed to 'cleaned_data'

Legend:

Unmodified
Added
Removed
Modified
  • CookBookDualSessionMiddleware

    v4 v5  
    9292            form = LoginForm(request.POST)
    9393            if form.is_valid():
    94                 user = auth.authenticate(username = form.clean_data['username'],
    95                                          password = form.clean_data['password'])
     94                user = auth.authenticate(username = form.cleaned_data['username'],
     95                                         password = form.cleaned_data['password'])
    9696                if user:
    9797                    if user.is_active:
    9898                        auth.login(request, user)
    99                         request.session[settings.PERSISTENT_SESSION_KEY] = form.clean_data['remember_user']
     99                        request.session[settings.PERSISTENT_SESSION_KEY] = form.cleaned_data['remember_user']
    100100                        # login successful, redirect
    101101                        return HttpResponseRedirect('/')
     
    144144    def clean(self):
    145145        try:
    146             user = User.objects.get(username__iexact = self.clean_data['username'])
     146            user = User.objects.get(username__iexact = self.cleaned_data['username'])
    147147        except User.DoesNotExist, KeyError:
    148148            raise forms.ValidationError('Invalid username, please try again.')
    149149       
    150         if not user.check_password(self.clean_data['password']):
     150        if not user.check_password(self.cleaned_data['password']):
    151151            raise forms.ValidationError('Invalid password, please try again.')
    152152       
    153         return self.clean_data
     153        return self.cleaned_data
    154154}}}
    155155
Back to Top