def clean_password(self):
        try:
            username = self.user.get_username()   # Django 1.5 and above
        except __HOLE__:                    # pragma: nocover
            username = self.user.username         # Django 1.4
        if auth.authenticate(username=username, password=self.data['password']):
            return self.data['password']
        raise forms.ValidationError(_('Incorrect password'))
dataset/ETHPy150Open mattrobenolt/django-sudo/sudo/forms.py/SudoForm.clean_password