Re: Create a shortcut for raising ValidationError from within the Form.clean() method

2019-09-06 Thread Lucas Weyne
Hi Adam, Your refactor works great and thats how I was thinking to solve this problem. My idea its was use the Meta.error_messages dictionary to solve default error messages. What if I want to raise a ValidationError for a conditional required field and display the default required message *T

Create a shortcut for raising ValidationError from within the Form.clean() method

2019-09-06 Thread Lucas Weyne
I want to create a shortcut method to raise ValidationError inside the Form.clean() method. When we need to raise the same ValidationError (same message and same code) many times inside the Form.clean(), I should pass the same message every time. Would be cleaner, pass only the error code and