[Bugfix] 修复模板bug, 修复getattr bug

pull/446/head
ibuler 2017-05-22 20:18:13 +08:00
parent 24c1a931a5
commit d2620a655c
3 changed files with 5 additions and 7 deletions

View File

@ -112,7 +112,6 @@
</div> </div>
</div> </div>
</div> </div>
{% include 'assets/_asset_bulk_update_modal.html' %}
{% endblock %} {% endblock %}
{% block custom_foot_js %} {% block custom_foot_js %}
<script src="{% static 'js/jquery.form.min.js' %}"></script> <script src="{% static 'js/jquery.form.min.js' %}"></script>

View File

@ -57,7 +57,7 @@ class AssetPermission(models.Model):
for user in user_group.users.all(): for user in user_group.users.all():
setattr(user, 'is_inherit_from_user_groups', True) setattr(user, 'is_inherit_from_user_groups', True)
setattr(user, 'inherit_from_user_groups', 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) users.add(user)
return users return users
@ -70,7 +70,7 @@ class AssetPermission(models.Model):
for asset in asset_group.assets.all(): for asset in asset_group.assets.all():
setattr(asset, 'is_inherit_from_asset_groups', True) setattr(asset, 'is_inherit_from_asset_groups', True)
setattr(asset, 'inherit_from_asset_groups', 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) assets.add(asset)
return assets return assets

View File

@ -77,22 +77,21 @@
{% csrf_token %} {% csrf_token %}
<tr class="no-borders-tr"> <tr class="no-borders-tr">
<td colspan="1" style="padding-top: 0"> <td colspan="1" style="padding-top: 0">
{% bootstrap_field form.name layout="horizontal" %}
</td> </td>
</tr> </tr>
<tr class="no-borders-tr"> <tr class="no-borders-tr">
<td colspan="1" style="padding-top: 0"> <td colspan="1" style="padding-top: 0">
{% bootstrap_field form.asset layout="horizontal" %} {% bootstrap_field form.assets %}
</td> </td>
</tr> </tr>
<tr class="no-borders-tr"> <tr class="no-borders-tr">
<td colspan="1" style="padding-top: 0"> <td colspan="1" style="padding-top: 0">
{% bootstrap_field form.asset_groups layout="horizontal" %} {% bootstrap_field form.asset_groups %}
</td> </td>
</tr> </tr>
<tr class="no-borders-tr"> <tr class="no-borders-tr">
<td colspan="1" style="padding-top: 0"> <td colspan="1" style="padding-top: 0">
{% bootstrap_field form.system_users layout="horizontal" %} {% bootstrap_field form.system_users %}
</td> </td>
</tr> </tr>
<tr class="no-borders-tr"> <tr class="no-borders-tr">