Skip to content

Commit

Permalink
Uncrispify BooleanSensorForm in ipdevpoll
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Oct 8, 2024
1 parent b3aba5e commit fb52d6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
10 changes: 1 addition & 9 deletions python/nav/web/ipdevinfo/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,4 @@ class BooleanSensorForm(forms.Form):
label='What to display in "on" state', choices=Sensor.ALERT_TYPE_CHOICES
)

def __init__(self, *args, **kwargs):
"""Init"""
super(BooleanSensorForm, self).__init__(*args, **kwargs)

self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
'on_message', 'off_message', 'on_state', 'alert_type'
)
attrs = set_flat_form_attributes()
8 changes: 5 additions & 3 deletions python/nav/web/templates/ipdevinfo/sensor-details.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "ipdevinfo/base.html" %}
{% load thresholds %}
{% load crispy_forms_tags %}


{% block base_header_additional_head %}
Expand Down Expand Up @@ -105,8 +104,11 @@ <h4>Display values</h4>
Add to dashboard
</button>
<form method="post">
{% csrf_token %}
{% crispy form %}
{% if form.attrs %}
{% include 'custom_crispy_templates/_form_content.html' %}
{% else %}
{{ form }}
{% endif %}
<button type="submit" class="button small">Update settings</button>
</form>
{% else %}
Expand Down

0 comments on commit fb52d6a

Please sign in to comment.