diff --git a/authentik/policies/reputation/models.py b/authentik/policies/reputation/models.py index a6a6bd7df..5eab67531 100644 --- a/authentik/policies/reputation/models.py +++ b/authentik/policies/reputation/models.py @@ -4,7 +4,6 @@ from django.db import models from django.utils.translation import gettext as _ from rest_framework.serializers import BaseSerializer -from authentik.core.models import User from authentik.lib.utils.http import get_client_ip from authentik.policies.models import Policy from authentik.policies.types import PolicyRequest, PolicyResult diff --git a/authentik/policies/reputation/tasks.py b/authentik/policies/reputation/tasks.py index 8904fb6c7..4af1f39e6 100644 --- a/authentik/policies/reputation/tasks.py +++ b/authentik/policies/reputation/tasks.py @@ -2,7 +2,6 @@ from django.core.cache import cache from structlog.stdlib import get_logger -from authentik.core.models import User from authentik.events.monitored_tasks import MonitoredTask, TaskResult, TaskResultStatus from authentik.policies.reputation.models import IPReputation, UserReputation from authentik.policies.reputation.signals import ( diff --git a/authentik/policies/reputation/tests.py b/authentik/policies/reputation/tests.py index 00c5e6894..4c73e514e 100644 --- a/authentik/policies/reputation/tests.py +++ b/authentik/policies/reputation/tests.py @@ -44,7 +44,9 @@ class TestReputationPolicy(TestCase): self.assertEqual(cache.get(CACHE_KEY_USER_PREFIX + self.test_username), -1) # Save cache and check db values save_user_reputation.delay().get() - self.assertEqual(UserReputation.objects.get(user=self.user).score, -1) + self.assertEqual( + UserReputation.objects.get(username=self.test_username).score, -1 + ) def test_policy(self): """Test Policy"""