Validate that the given value contains no whitespaces to prevent common typos.
(value)
| 10 | |
| 11 | |
| 12 | def _simple_domain_name_validator(value): |
| 13 | """ |
| 14 | Validate that the given value contains no whitespaces to prevent common |
| 15 | typos. |
| 16 | """ |
| 17 | checks = ((s in value) for s in string.whitespace) |
| 18 | if any(checks): |
| 19 | raise ValidationError( |
| 20 | _("The domain name cannot contain any spaces or tabs."), |
| 21 | code="invalid", |
| 22 | ) |
| 23 | |
| 24 | |
| 25 | class SiteManager(models.Manager): |
nothing calls this directly
no test coverage detected