Django create new user without password
<p>I'm creating new users using a custom <code>UserCreationForm</code> and then using <code>password_reset</code> from <code>auth.views</code> with a customized email template to send a signup mail to the user.</p>
<p>This process is working fine, users are able to successfully complete the signup process and start using the app. I now want to create users without having to set a password for the user.</p>
<p>I tried setting <code>self.fields['password1'].required</code> and <code>self.fields['password2'].required</code> to <code>False</code>
in the <code>UserCreationForm</code> init method as recommended <a href="http://django-authtools.readthedocs.org/en/latest/how-to/invitation-email.html" rel="noreferrer">here</a> but that hasn't worked for me. Unfortunately, it's proving difficult to debug. I'm not seeing any error messages but I know the <code>RegistrationView</code> register method isn't getting called.</p>
<p>Here's my <code>UserCreationForm</code></p>
<pre><code>class UserCreateForm(UserCreationForm):
    email = forms.EmailField(required=True)

    class Meta:
        model = User
        fields = (&quot;email&quot;,)

    def __int__(self):
        self.fields['password1'].required = False
        self.fields['password2'].required = False

    def save(self, commit=True):
        user = super(UserCreateForm, self).save(commit=False)
        clean_email = self.cleaned_data[&quot;email&quot;]
        user.email = clean_email
        if commit:
            user.save()
        custom_user = CustomUser()
        custom_user.id = user
        custom_user.save()
        return user
</code></pre>
<p>Here's my <code>RegistrationView</code></p>
<pre><code>class UserRegistration(RegistrationView):
    def __init__(self):
        self.form_class = UserCreateForm
        self.success_url = 'login'
        self.template_name = 'register.html'

    def register(self, request, form):
        new_user = form.save()
</code></pre>
<p>I'm using Django 1.8. Please let me know if any other information would be useful to share.</p>