'Given a username, email address and password, register a new
user account, which will initially be inactive.
Along with the new ``User`` object, a new
``registration.models.RegistrationProfile`` will be created,
tied to that ``User``, containing the activation key which
will be used for this account.
An email will be sent to the supplied email address; this
email should contain an activation link. The email will be
rendered using two templates. See the documentation for
``RegistrationProfile.send_activation_email()`` for
information about these templates and the contexts provided to
them.
After the ``User`` and ``RegistrationProfile`` are created and
the activation email is sent, the signal
``registration.signals.user_registered`` will be sent, with
the new ``User`` as the keyword argument ``user`` and the
class of this backend as the sender.'

def register(self, form):

    site = get_current_site(self.request)
    if hasattr(form, 'save'):
        new_user_instance = form.save()
    else:
        new_user_instance = UserModel().objects.create_user(**form.cleaned_data)
    new_user = self.registration_profile.objects.create_inactive_user(new_user=new_user_instance, site=site, send_email=self.SEND_ACTIVATION_EMAIL, request=self.request)
    signals.user_registered.send(sender=self.__class__, user=new_user, request=self.request)
    return new_user
