MCPcopy
hub / github.com/django/django / clean_username

Method clean_username

tests/admin_views/forms.py:13–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11 css = {"all": ("path/to/media.css",)}
12
13 def clean_username(self):
14 username = self.cleaned_data.get("username")
15 if username == "customform":
16 raise ValidationError("custom form error")
17 return username
18
19
20class CustomAdminPasswordChangeForm(AdminPasswordChangeForm):

Callers

nothing calls this directly

Calls 2

ValidationErrorClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected