From 6de524c797b40fbd3e00aa663257fc5f6b7712df Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 7 Mar 2024 15:20:31 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=B8=8D=E6=BB=A1=E8=B6=B3=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=99=BB=E5=BD=95=E5=8B=BE=E9=80=89=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=E4=BB=8E=E7=A6=81=E7=94=A8=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/authentication/forms.py b/apps/authentication/forms.py index 5f56a4a98..7ef073443 100644 --- a/apps/authentication/forms.py +++ b/apps/authentication/forms.py @@ -43,6 +43,8 @@ class UserLoginForm(forms.Form): super().__init__(*args, **kwargs) auto_login_field = self.fields['auto_login'] auto_login_field.label = _("{} days auto login").format(self.days_auto_login or 1) + if self.disable_days_auto_login: + auto_login_field.widget = forms.HiddenInput() def confirm_login_allowed(self, user): if not user.is_staff: