From bb9af5bdae7c1e59b79452ec0ca31c10ff253ba0 Mon Sep 17 00:00:00 2001 From: Simon Oliver Tveit Date: Thu, 7 Nov 2024 09:35:19 +0100 Subject: [PATCH] Uncrispify AccountChartsForm --- python/nav/web/radius/forms.py | 11 ++++------- python/nav/web/templates/radius/account_charts.html | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/python/nav/web/radius/forms.py b/python/nav/web/radius/forms.py index a6eb3c9e34..294c6b870c 100644 --- a/python/nav/web/radius/forms.py +++ b/python/nav/web/radius/forms.py @@ -20,8 +20,6 @@ from django.core.validators import validate_ipv4_address from django.core.validators import validate_integer as django_validate_integer -from crispy_forms.helper import FormHelper -from crispy_forms_foundation.layout import Layout, Submit from nav.web.crispyforms import ( set_flat_form_attributes, FormColumn, @@ -255,9 +253,8 @@ class AccountChartsForm(forms.Form): def __init__(self, *args, **kwargs): super(AccountChartsForm, self).__init__(*args, **kwargs) - self.helper = FormHelper() - self.helper.form_action = '' - self.helper.form_method = 'GET' - self.helper.layout = Layout( - 'days', 'charts', Submit('send', 'Show me', css_class='small') + self.attrs = set_flat_form_attributes( + form_method='get', + form_fields=[self['days'], self['charts']], + submit_field=SubmitField('send', 'Show me', css_classes='small'), ) diff --git a/python/nav/web/templates/radius/account_charts.html b/python/nav/web/templates/radius/account_charts.html index 8665b5cd43..1780dbaf1c 100644 --- a/python/nav/web/templates/radius/account_charts.html +++ b/python/nav/web/templates/radius/account_charts.html @@ -1,5 +1,4 @@ {% extends "radius/base.html" %} -{% load crispy_forms_tags %} {% load radius %} {% block content %} @@ -16,7 +15,7 @@

Show top 6 talkers

- {% crispy form %} + {% include 'custom_crispy_templates/flat_form.html' %}