Skip to content

Commit

Permalink
Uncrispify ChangePasswordForm
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit committed Oct 4, 2024
1 parent 468b71c commit ef4d14c
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions python/nav/web/webfront/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
from django.forms.models import modelformset_factory
from django.urls import reverse
from crispy_forms.helper import FormHelper
from crispy_forms_foundation.layout import Layout, Fieldset, Row, Column, HTML, Submit
from crispy_forms_foundation.layout import Layout, Fieldset, Row, Column, HTML
from nav.models.profiles import NavbarLink, Account
from nav.web.crispyforms import (
CheckBox,
NavSubmit,
SubmitField,
set_flat_form_attributes,
FlatFieldset,
)


Expand Down Expand Up @@ -96,16 +97,18 @@ def __init__(self, *args, **kwargs):

super(ChangePasswordForm, self).__init__(*args, **kwargs)

self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
Fieldset(
'Change password',
'old_password',
'new_password1',
'new_password2',
Submit('submit', 'Change password', css_class='small'),
)
self.attrs = set_flat_form_attributes(
form_fields=[
FlatFieldset(
legend='Change password',
fields=[
self['old_password'],
self['new_password1'],
self['new_password2'],
SubmitField(value='Change password', css_classes='small'),
],
)
],
)

def clean_old_password(self):
Expand Down

0 comments on commit ef4d14c

Please sign in to comment.