Skip to content

Form: prevalidation form tuning #11270

@agjohnson

Description

@agjohnson

A few notes to come back to for tuning on this pattern:

  • Turn the prevalidate form into a mixin, so that the base form can be forms.Form or forms.ModelForm without struggling with any conflicts. Maybe this isn't necessary.
  • is_disabled should reference self.errors I think. This would populate the prevalidation errors if form.errors wasn't called first. The use case here is when displaying the form, we might use <form {% if form.is_disabled %}inert{% endif %}> before we actually call {{ form | crispy }}. The crispy filter calls form.errors which populates all the validation errors.
  • Project: create forms are still usable by keyboard when disabled ext-theme#279 -- a few options here are <form inert>, disabling all of the fields in the Form class, or wrapping with .ui.disabled.segment instead. There is no .ui.disabled.form unfortunately.
  • Revisit disabling forms pattern in Add Pull Request builds page to settings #10656 and related PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedAccepted issue on our roadmapImprovementMinor improvement to code

    Type

    No type

    Projects

    Status

    Planned

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions