From e3aaba479855a78976b3608dac3485728ea1c564 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 24 Jul 2023 14:57:49 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=8E=BB=E6=8E=89=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/applications/migrations/0006_application.py | 1 - apps/authentication/signal_handlers.py | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/applications/migrations/0006_application.py b/apps/applications/migrations/0006_application.py index 0333b860d..423e9468a 100644 --- a/apps/applications/migrations/0006_application.py +++ b/apps/applications/migrations/0006_application.py @@ -2,7 +2,6 @@ from django.db import migrations, models import django.db.models.deletion -import django_mysql.models import uuid diff --git a/apps/authentication/signal_handlers.py b/apps/authentication/signal_handlers.py index e9de006fe..b1f55f689 100644 --- a/apps/authentication/signal_handlers.py +++ b/apps/authentication/signal_handlers.py @@ -10,6 +10,7 @@ from apps.jumpserver.settings.auth import AUTHENTICATION_BACKENDS_THIRD_PARTY from .signals import post_auth_success, post_auth_failed, user_auth_failed, user_auth_success +@receiver(user_logged_in) def on_user_auth_login_success(sender, user, request, **kwargs): # 失效 perms 缓存 user.expire_rbac_perms_cache() @@ -51,6 +52,3 @@ def on_user_login_success(sender, request, user, backend, create=False, **kwargs def on_user_login_failed(sender, username, request, reason, backend, **kwargs): request.session['auth_backend'] = backend post_auth_failed.send(sender, username=username, request=request, reason=reason) - - -user_logged_in.connect(on_user_auth_login_success)