From fb52d6af263d613331951eb1004a17aea8d831a1 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Mon, 7 Oct 2024 13:23:32 +0200 Subject: [PATCH] Uncrispify BooleanSensorForm in ipdevpoll --- python/nav/web/ipdevinfo/forms.py | 10 +--------- python/nav/web/templates/ipdevinfo/sensor-details.html | 8 +++++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/python/nav/web/ipdevinfo/forms.py b/python/nav/web/ipdevinfo/forms.py index 259f6da210..6afe0616c9 100644 --- a/python/nav/web/ipdevinfo/forms.py +++ b/python/nav/web/ipdevinfo/forms.py @@ -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() diff --git a/python/nav/web/templates/ipdevinfo/sensor-details.html b/python/nav/web/templates/ipdevinfo/sensor-details.html index 66c0a809ff..096aee7d9f 100644 --- a/python/nav/web/templates/ipdevinfo/sensor-details.html +++ b/python/nav/web/templates/ipdevinfo/sensor-details.html @@ -1,6 +1,5 @@ {% extends "ipdevinfo/base.html" %} {% load thresholds %} -{% load crispy_forms_tags %} {% block base_header_additional_head %} @@ -105,8 +104,11 @@

Display values

Add to dashboard
- {% csrf_token %} - {% crispy form %} + {% if form.attrs %} + {% include 'custom_crispy_templates/_form_content.html' %} + {% else %} + {{ form }} + {% endif %}
{% else %}