mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-30 08:42:04 +00:00
Finish some bug
This commit is contained in:
parent
34a0a37b63
commit
05a5e9cc69
@ -73,8 +73,15 @@ class SystemUserAuthApi(APIView):
|
|||||||
system_user = get_object_or_none(SystemUser, id=system_user_id, username=system_user_username)
|
system_user = get_object_or_none(SystemUser, id=system_user_id, username=system_user_username)
|
||||||
|
|
||||||
if system_user:
|
if system_user:
|
||||||
password = signer.sign(system_user.password)
|
if system_user.password:
|
||||||
private_key = signer.sign(system_user.private_key)
|
password = signer.sign(system_user.password)
|
||||||
|
else:
|
||||||
|
password = signer.sign('')
|
||||||
|
|
||||||
|
if system_user.private_key:
|
||||||
|
private_key = signer.sign(system_user.private_key)
|
||||||
|
else:
|
||||||
|
private_key = signer.sign(None)
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
'id': system_user.id,
|
'id': system_user.id,
|
||||||
|
@ -242,7 +242,7 @@ class SystemUserForm(forms.ModelForm):
|
|||||||
# Todo: Validate private key file, and generate public key
|
# Todo: Validate private key file, and generate public key
|
||||||
# Todo: Auto generate private key and public key
|
# Todo: Auto generate private key and public key
|
||||||
if private_key_file:
|
if private_key_file:
|
||||||
system_user.private_key = private_key_file.read()
|
system_user.private_key = private_key_file.read().strip()
|
||||||
system_user.save()
|
system_user.save()
|
||||||
return self.instance
|
return self.instance
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Asset user' %}</h3>
|
<h3>{% trans 'Asset user' %}</h3>
|
||||||
{{ form.admin_user|bootstrap_horizontal }}
|
{{ form.admin_user|bootstrap_horizontal }}
|
||||||
{{ form.system_users|bootstrap_horizontal }}
|
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Other' %}</h3>
|
<h3>{% trans 'Other' %}</h3>
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Asset user' %}</h3>
|
<h3>{% trans 'Asset user' %}</h3>
|
||||||
{{ form.admin_user|bootstrap_horizontal }}
|
{{ form.admin_user|bootstrap_horizontal }}
|
||||||
{{ form.system_users|bootstrap_horizontal }}
|
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Hardware' %}</h3>
|
<h3>{% trans 'Hardware' %}</h3>
|
||||||
|
@ -46,8 +46,6 @@ class AssetListView(AdminUserRequiredMixin, ListView):
|
|||||||
return super(AssetListView, self).get_context_data(**kwargs)
|
return super(AssetListView, self).get_context_data(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AssetCreateView(AdminUserRequiredMixin,CreateAssetTagsMiXin,CreateView):
|
class AssetCreateView(AdminUserRequiredMixin,CreateAssetTagsMiXin,CreateView):
|
||||||
model = Asset
|
model = Asset
|
||||||
tag_type = 'asset'
|
tag_type = 'asset'
|
||||||
|
Loading…
Reference in New Issue
Block a user