Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using __file__ at module level in django.contrib.auth.password_…
…validation The `CommonPasswordValidator`-class constant `DEFAULT_PASSWORD_LIST_PATH` is used only in one place, the class's instance constructor. While the nature of `DEFAULT_PASSWORD_LIST_PATH` is not documented, its existence is inside the docs for the [constructor's signature]. I've changed `DEFAULT_PASSWORD_LIST_PATH` from a class constant into an instance attribute. Another possibility is making `DEFAULT_PASSWORD_LIST_PATH` be a `django.utils.functional.classproperty`. [constructor's signature]: https://docs.djangoproject.com/en/3.1/topics/auth/passwords/#django.contrib.auth.password_validation.CommonPasswordValidator
- Loading branch information