(self)
| 41 | ) |
| 42 | |
| 43 | def clean_url(self): |
| 44 | url = self.cleaned_data["url"] |
| 45 | if not url.startswith("/"): |
| 46 | raise ValidationError( |
| 47 | gettext("URL is missing a leading slash."), |
| 48 | code="missing_leading_slash", |
| 49 | ) |
| 50 | if self._trailing_slash_required() and not url.endswith("/"): |
| 51 | raise ValidationError( |
| 52 | gettext("URL is missing a trailing slash."), |
| 53 | code="missing_trailing_slash", |
| 54 | ) |
| 55 | return url |
| 56 | |
| 57 | def clean(self): |
| 58 | url = self.cleaned_data.get("url") |
nothing calls this directly
no test coverage detected