Commits

dready  committed c58e4eb

DefaultBackend.register passes the rest of **kwargs to create_inactive_user

so we can customize the activation email

  • Participants
  • Parent commits 488a6c1

Comments (0)

Files changed (1)

File registration/backends/default/__init__.py

         rendered using two templates. See the documentation for
         ``RegistrationProfile.send_activation_email()`` for
         information about these templates and the contexts provided to
-        them.
+        them. An additional context dict may be specified using the
+        ``extra_context`` argument.
 
         After the ``User`` and ``RegistrationProfile`` are created and
         the activation email is sent, the signal
         class of this backend as the sender.
 
         """
-        username, email, password = kwargs['username'], kwargs['email'], kwargs['password1']
+        username, email, password = kwargs.pop('username'), kwargs.pop('email'), kwargs.pop('password1')
         if Site._meta.installed:
             site = Site.objects.get_current()
         else:
             site = RequestSite(request)
+
         new_user = RegistrationProfile.objects.create_inactive_user(username, email,
-                                                                    password, site)
+                                                                    password, site, **kwargs)
         signals.user_registered.send(sender=self.__class__,
                                      user=new_user,
                                      request=request)