From 870b863136708518f68af3a264769da1889615c4 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 27 Feb 2018 15:04:05 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9Brequire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/templates/assets/asset_list.html | 2 +- apps/common/forms.py | 2 +- apps/users/models/user.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/assets/templates/assets/asset_list.html b/apps/assets/templates/assets/asset_list.html index 8a56f2c0f..62996cc47 100644 --- a/apps/assets/templates/assets/asset_list.html +++ b/apps/assets/templates/assets/asset_list.html @@ -415,7 +415,7 @@ $(document).ready(function(){ current_node = nodes[0]; url += "?node_id=" + current_node.id; } - window.open(url); + window.open(url, '_self'); }) .on('click', '.btn_asset_delete', function () { var $this = $(this); diff --git a/apps/common/forms.py b/apps/common/forms.py index d7e6b104b..8a6c87fe4 100644 --- a/apps/common/forms.py +++ b/apps/common/forms.py @@ -71,7 +71,7 @@ class BasicSettingForm(BaseForm): help_text="eg: http://jumpserver.abc.com:8080" ) USER_GUIDE_URL = forms.URLField( - label=_("User Guide URL"), + label=_("User Guide URL"), required=False, help_text=_("User first login update profile done redirect to it") ) EMAIL_SUBJECT_PREFIX = forms.CharField( diff --git a/apps/users/models/user.py b/apps/users/models/user.py index 8ef432108..25d7d0303 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -151,6 +151,10 @@ class User(AbstractUser): def save(self, *args, **kwargs): if not self.name: self.name = self.username + if self.username == 'admin': + self.role = 'Admin' + self.is_active = True + super().save(*args, **kwargs) @property