mirror of https://github.com/jumpserver/jumpserver
[Update] 修复授权规则更新失败的bug
parent
423a487bd1
commit
0512988979
|
@ -34,7 +34,7 @@ class ActionField(forms.MultipleChoiceField):
|
|||
|
||||
|
||||
class AssetPermissionForm(OrgModelForm):
|
||||
action = ActionField()
|
||||
actions = ActionField()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
@ -73,7 +73,6 @@ class AssetPermissionForm(OrgModelForm):
|
|||
'system_users': forms.SelectMultiple(
|
||||
attrs={'class': 'select2', 'data-placeholder': _('System user')}
|
||||
),
|
||||
'actions': forms.CheckboxSelectMultiple()
|
||||
}
|
||||
labels = {
|
||||
'nodes': _("Node"),
|
||||
|
|
|
@ -159,7 +159,6 @@ $(document).ready(function () {
|
|||
objectAttrsIsList(data, ['users', 'user_groups', 'system_users', 'nodes', 'assets', 'actions']);
|
||||
objectAttrsIsDatetime(data, ['date_start', 'date_expired']);
|
||||
objectAttrsIsBool(data, ['is_active']);
|
||||
console.log(data)
|
||||
var props = {
|
||||
url: the_url,
|
||||
data: data,
|
||||
|
|
|
@ -1082,7 +1082,10 @@ function htmlEscape ( d ) {
|
|||
|
||||
function objectAttrsIsList(obj, attrs) {
|
||||
attrs.forEach(function (attr) {
|
||||
if (obj[attr] && !(obj[attr] instanceof Array)){
|
||||
if (!obj[attr]){
|
||||
obj[attr] = []
|
||||
}
|
||||
else if (obj[attr] && !(obj[attr] instanceof Array)){
|
||||
obj[attr] = [obj[attr]]
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue