Proposed Changes
- Keep
AccessList.name
as a CharField
.
- Add Django’s
validate_slug
validator to the field (no field-type change).
- Update tests accordingly.
Justification
Replace the custom RegexValidator
for AccessList.name
with Django’s built-in validate_slug
to reduce custom code and resolve the test suite’s invalid escape sequence warning.
- Remove bespoke validation logic in favor of a built-in validator.
- Keep behavior explicit and maintainable.
References