def get_last_failed_access_attempt(cls, **kwargs):
        """
        Return Failed access attempt of Client
        :param ip_adress: String
        :return:
        """
        try:
            lockout = cls.objects.get(
                **kwargs
            )
        except cls.DoesNotExist:
            lockout = None

        if lockout:
            time_remaining = lockout.expiration_time
            if time_remaining and time_remaining <= 0:
                lockout.is_expired = True
                lockout.save()
                return None

        return lockout
def get_last_failed_access_attempt ( cls , ** kwargs ) : try : lockout = cls . objects . get ( ** kwargs ) except cls . DoesNotExist : lockout = None if lockout : time_remaining = lockout . expiration_time if time_remaining and time_remaining <= 0 : lockout . is_expired = True lockout . save ( ) return None return lockout
Return Failed access attempt of Client
        :param ip_adress: String
        :return: