From add696be9dc2d28c7a586a2ae4aad357f2c24437 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Fri, 15 Nov 2024 13:34:52 +0100 Subject: [PATCH 1/2] Remove unused crispy CheckBox --- python/nav/web/crispyforms.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/python/nav/web/crispyforms.py b/python/nav/web/crispyforms.py index a91e24cf6f..8a449ccd96 100644 --- a/python/nav/web/crispyforms.py +++ b/python/nav/web/crispyforms.py @@ -18,13 +18,6 @@ from typing import Optional from django import forms -from crispy_forms_foundation.layout import Field - - -class CheckBox(Field): - """Checkbox suited for the NAV layout""" - - template = 'custom_crispy_templates/horizontal_checkbox.html' class FormCheckBox: From 00b9b5e04f4a67f94db6f188ed703baf423265aa Mon Sep 17 00:00:00 2001 From: Johanna England Date: Fri, 15 Nov 2024 13:40:16 +0100 Subject: [PATCH 2/2] Rename FormCheckBox to CheckBox After the crispy CheckBox has been removed this can be renamed --- python/nav/web/arnold/forms.py | 6 +++--- python/nav/web/crispyforms.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/nav/web/arnold/forms.py b/python/nav/web/arnold/forms.py index a8ca81775d..2622b4c46d 100644 --- a/python/nav/web/arnold/forms.py +++ b/python/nav/web/arnold/forms.py @@ -20,8 +20,8 @@ from nav.util import is_valid_ip, is_valid_mac from nav.web.crispyforms import ( + CheckBox, FlatFieldset, - FormCheckBox, FormColumn, FormDiv, FormRow, @@ -243,7 +243,7 @@ def __init__(self, *args, **kwargs): fields=[self['keep_closed']], css_classes='medium-4' ), FormColumn( - fields=[FormCheckBox(self['exponential'])], + fields=[CheckBox(self['exponential'])], css_classes='medium-4', ), FormDiv(css_classes='medium-4 columns'), @@ -254,7 +254,7 @@ def __init__(self, *args, **kwargs): ], css_class='secondary', ), - FormCheckBox(self['active']), + CheckBox(self['active']), ], submit_field=SubmitField(value='Save'), ) diff --git a/python/nav/web/crispyforms.py b/python/nav/web/crispyforms.py index 8a449ccd96..dcc6a36e1f 100644 --- a/python/nav/web/crispyforms.py +++ b/python/nav/web/crispyforms.py @@ -20,7 +20,7 @@ from django import forms -class FormCheckBox: +class CheckBox: """Checkbox suited for the NAV layout :param field: A field to render as a checkbox field.