Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to to disable non field errors #1380

Open
medihack opened this issue Feb 25, 2024 · 4 comments
Open

Option to to disable non field errors #1380

medihack opened this issue Feb 25, 2024 · 4 comments

Comments

@medihack
Copy link
Contributor

  • Package version: 2.1
  • Django version: 4.2.10
  • Python version: 3.12
  • Template pack: crispy-bootstrap5 2023.10

Description:

I am dealing with a complex form that attaches two layout helpers to one form as parts of the form are rendered in two different locations. Unfortunately, there is currently no option to disable the non_field_errors on its own (only all field errors using form_show_errors). That is why these non_field_errors are rendered twice in this case (on top of each form helper). I must overwrite the whole form template to disable the "non_field_errors" on one of these layouts.

Wouldn't something like form_show_non_field_errors be a good addition to django_crispy_forms? It would also help if the non_field_errors should be rendered in a completely different location (and not just at the top of the form).

@smithdc1
Copy link
Member

Hi @medihack -- sounds reasonable to me.

Would you be able to work on a PR for this?

@medihack
Copy link
Contributor Author

Sure, but it will take some time. Must it also be supported in all template packs?

@smithdc1
Copy link
Member

I think one would be amazing. Then we can open issues on the other projects linking to an example of the changes required.

@medihack
Copy link
Contributor Author

Alright, I will look into it when I have some time left and implement it for the bootstrap (at least bootstrap5) pack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants