# custom validation error in password\_validators

**URL:** https://forum.djangoproject.com/t/custom-validation-error-in-password-validators/16497
**Category:** Django Internals
**Created:** [October 17, 2022, 7:40am UTC](https://forum.djangoproject.com/t/custom-validation-error-in-password-validators/16497 "2022-10-17T07:40:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mojtabaakbari](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mojtabaakbari/32/10444_2.png) [@mojtabaakbari](https://forum.djangoproject.com/u/mojtabaakbari)
#### Post date: [October 17, 2022, 7:40am UTC](https://forum.djangoproject.com/t/custom-validation-error-in-password-validators/16497/1 "2022-10-17T07:40:51Z")

</div>

i wanna have custom validation error in password\_validators,  
I can do this by rewriting the password validator classes and adding desired messages through options in the settings file and the password\_validat section.

something like this :

```auto
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
        'OPTIONS': {
            'validation_error': 'My Custom Validation Error.',
        },
    },
    ...
]

```

and so on.

Apart from that I want to return custom validation error, for example in our company project we want to send our language based message without enabling t10n and l18n. Or ux writer wants to show the user the desired error according to business needs,  
But it is not possible unless we directly override the password\_validation classes and this is an extra and dirty work.

Is it worth the time? After spending some time, can I make a pull request?
