Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #219 from GreatFruitOmsk/issue_212
Browse files Browse the repository at this point in the history
Titlecase conversion of None
  • Loading branch information
vpetersson authored May 29, 2019
2 parents db1cbee + 4d41134 commit a2f57ea
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions backend/device_registry/templates/device_info_security.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,27 @@ <h4 class="tab-title">Security</h4>
</tr>
<tr>
<th scope="row">AppArmor Enabled</th>
<td>
{{ object.deviceinfo.app_armor_enabled|title|default_if_none:'N/A' }}
{% if object.deviceinfo.app_armor_enabled is not None %}
<span class="p-1 badge badge-pill badge-{{ object.deviceinfo.app_armor_enabled|yesno:"success,warning" }}">
<td>
{% if object.deviceinfo.app_armor_enabled is None %}N/A{% else %}
{{ object.deviceinfo.app_armor_enabled|title }}
<span
class="p-1 badge badge-pill badge-{{ object.deviceinfo.app_armor_enabled|yesno:"success,warning" }}">
{{ object.deviceinfo.app_armor_enabled|yesno:"✓,✗" }}
</span>
{% endif %}
</td>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Default Password Detected</th>
<td>
{{ object.deviceinfo.default_password|title|default_if_none:'N/A' }}
{% if object.deviceinfo.default_password is not None %}
<span class="p-1 badge badge-pill badge-{{ object.deviceinfo.default_password|yesno:"danger,success" }}">
<td>
{% if object.deviceinfo.default_password is None %}N/A{% else %}
{{ object.deviceinfo.default_password|title }}
<span
class="p-1 badge badge-pill badge-{{ object.deviceinfo.default_password|yesno:"danger,success" }}">
{{ object.deviceinfo.default_password|yesno:"✗,✓" }}
</span>
{% endif %}
</td>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Logins</th>
Expand All @@ -93,12 +95,12 @@ <h4 class="tab-title">Security</h4>
<tr>
<th scope="row">Firewall Enabled</th>
<td>
{{ object.firewallstate.enabled|title|default_if_none:'N/A' }}
{% if object.firewallstate.enabled is not None %}
<span class="p-1 badge badge-pill badge-{{ object.firewallstate.enabled|yesno:"success,danger" }}">
{% if object.firewallstate.enabled is None %}N/A{% else %}
{{ object.firewallstate.enabled|title }}
<span class="p-1 badge badge-pill badge-{{ object.firewallstate.enabled|yesno:"success,danger" }}">
{{ object.firewallstate.enabled|yesno:"✓,✗" }}
</span>
{% endif %}
{% endif %}
</td>
</tr>
<tr>
Expand Down

0 comments on commit a2f57ea

Please sign in to comment.