Example #1
0
    def authenticate(self, request, username=None, password=None):
        print('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$')
        if not username:
            return None

        novo = User(username=username)
        novo._set_pk_val(1)
        return novo
Example #2
0
    def authenticate_credentials(self, username, password, request=None):
        '''
        Authenticate the userid and password against username and password
        with optional request for context.
        '''

        if username is None:
            raise exceptions.AuthenticationFailed(
                _('Invalid username/password.'))

        user = User(username=username)

        if not user.is_active:
            raise exceptions.AuthenticationFailed(
                _('User inactive or deleted.'))

        self.enforce_csrf(request)
        user._set_pk_val(1)
        print(request, user)
        #auth.login(request,user)
        return (user, None)