title: How to clean username with Django allauth adapter?
body: <p>Django allauth validates usernames for illegal characters and uniqueness based on case insensitivity when signing up or logging in. That's great. But I would like to use the same validation on my own profile form that has a OneToOne with User. As it stands, I can't get the same logic in my Profile form.</p>
  
  <p>I thought it might be importing <code>DefaultAccountAdapter</code> and overriding <code>def clean_username</code>, but I get:</p>
  
  <pre><code>TypeError at /accounts/profile/
  clean_username() takes exactly 2 arguments (1 given)
  </code></pre>
  
  <p>My <code>forms.py</code>:</p>
  
  <pre><code>from allauth.account.adapter import DefaultAccountAdapter
  
  from .profiles.models import Profile
  
  
  class UserForm(forms.ModelForm):
  
      class Meta:
          model = get_user_model()
          fields = ('username', 'first_name', 'last_name',)
          widgets = {
              'username': forms.TextInput(
                  attrs={
                      'autocapitalize': 'off',
                      'autocorrect': 'off',
                      'placeholder': 'Username'
                  }
              ),
              'first_name': forms.TextInput(
                  attrs={
                      'autocapitalize': 'words',
                      'autocorrect': 'off',
                      'placeholder': 'First name'
                  }
              ),
              'last_name': forms.TextInput(
                  attrs={
                      'autocapitalize': 'words',
                      'autocorrect': 'off',
                      'placeholder': 'Last name'
                  }
              ),
          }
          help_texts = {
              'username': '',
          }
  
      def clean_username(self, username):
          adapter = DefaultAccountAdapter()
          username = adapter.clean_username(username)
          return username
  </code></pre>