'Validate that the username is alphanumeric and is not already
in use.'

def clean_username(self):

    try:
        get_user_model().objects.get(username__iexact=self.cleaned_data['username'])
    except get_user_model().DoesNotExist:
        return self.cleaned_data['username']
    raise forms.ValidationError(_('A    user    with    that    username    already    exists.'))
