Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
d2620a65
Commit
d2620a65
authored
May 22, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复模板bug, 修复getattr bug
parent
24c1a931
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
idc_assets.html
apps/assets/templates/assets/idc_assets.html
+0
-1
models.py
apps/perms/models.py
+2
-2
user_asset_permission.html
apps/users/templates/users/user_asset_permission.html
+3
-4
No files found.
apps/assets/templates/assets/idc_assets.html
View file @
d2620a65
...
...
@@ -112,7 +112,6 @@
</div>
</div>
</div>
{% include 'assets/_asset_bulk_update_modal.html' %}
{% endblock %}
{% block custom_foot_js %}
<script
src=
"{% static 'js/jquery.form.min.js' %}"
></script>
...
...
apps/perms/models.py
View file @
d2620a65
...
...
@@ -57,7 +57,7 @@ class AssetPermission(models.Model):
for
user
in
user_group
.
users
.
all
():
setattr
(
user
,
'is_inherit_from_user_groups'
,
True
)
setattr
(
user
,
'inherit_from_user_groups'
,
getattr
(
user
,
b
'inherit_from_user_groups'
,
set
())
.
add
(
user_group
))
getattr
(
user
,
'inherit_from_user_groups'
,
set
())
.
add
(
user_group
))
users
.
add
(
user
)
return
users
...
...
@@ -70,7 +70,7 @@ class AssetPermission(models.Model):
for
asset
in
asset_group
.
assets
.
all
():
setattr
(
asset
,
'is_inherit_from_asset_groups'
,
True
)
setattr
(
asset
,
'inherit_from_asset_groups'
,
getattr
(
asset
,
b
'inherit_from_user_groups'
,
set
())
.
add
(
asset_group
))
getattr
(
asset
,
'inherit_from_user_groups'
,
set
())
.
add
(
asset_group
))
assets
.
add
(
asset
)
return
assets
...
...
apps/users/templates/users/user_asset_permission.html
View file @
d2620a65
...
...
@@ -77,22 +77,21 @@
{% csrf_token %}
<tr
class=
"no-borders-tr"
>
<td
colspan=
"1"
style=
"padding-top: 0"
>
{% bootstrap_field form.name layout="horizontal" %}
</td>
</tr>
<tr
class=
"no-borders-tr"
>
<td
colspan=
"1"
style=
"padding-top: 0"
>
{% bootstrap_field form.asset
layout="horizontal"
%}
{% bootstrap_field form.asset
s
%}
</td>
</tr>
<tr
class=
"no-borders-tr"
>
<td
colspan=
"1"
style=
"padding-top: 0"
>
{% bootstrap_field form.asset_groups
layout="horizontal"
%}
{% bootstrap_field form.asset_groups %}
</td>
</tr>
<tr
class=
"no-borders-tr"
>
<td
colspan=
"1"
style=
"padding-top: 0"
>
{% bootstrap_field form.system_users
layout="horizontal"
%}
{% bootstrap_field form.system_users %}
</td>
</tr>
<tr
class=
"no-borders-tr"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment