Commit 1a8e040
committed
refactor(validators): Simplify and refactor password validators
This commit refactors the password validation classes to improve clarity, reduce complexity, and align better with Django conventions.
The key changes include:
- Removed the `BaseCountPasswordValidator` abstract base class, as it added unnecessary complexity. Each validator is now a self-contained class.
- Simplified the logic within each validator, using more direct and efficient methods for character checks (e.g., `isascii()`, `isupper()`).
- Renamed validator classes for conciseness (e.g., `ASCIIOnlyPasswordValidator` to `AsciiValidator`).
- Improved internationalization and pluralization of error messages by using `ngettext`.
- Updated `settings.py` to reflect the new validator class names and their simplified options.1 parent 90b6ce0 commit 1a8e040
2 files changed
+137
-189
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | | - | |
193 | | - | |
| 191 | + | |
194 | 192 | | |
195 | 193 | | |
196 | | - | |
197 | | - | |
| 194 | + | |
198 | 195 | | |
199 | 196 | | |
200 | 197 | | |
201 | | - | |
202 | 198 | | |
203 | 199 | | |
204 | 200 | | |
| |||
0 commit comments