Commits

Martins Grunskis committed fded0a9

add more extension points

Comments (0)

Files changed (3)

registration/backends/default/__init__.py

         
         """
         return ('registration_activation_complete', (), {})
+
+    def get_form_kwargs(self, request):
+        return {}
+
+    def get_extra_context(self, request):
+        return {}

registration/backends/simple/__init__.py

     def get_form_class(self, request):
         return RegistrationForm
 
+    def get_form_kwargs(self, request):
+        return {}
+
+    def get_extra_context(self, request):
+        return {}
+
     def post_registration_redirect(self, request, user):
         """
         After registration, redirect to the user's account page.

registration/views.py

             else:
                 return redirect(success_url)
     else:
-        form = form_class()
+        form = form_class(**backend.get_form_kwargs(request))
     
     if extra_context is None:
-        extra_context = {}
+        extra_context = backend.get_extra_context(request)
     context = RequestContext(request)
     for key, value in extra_context.items():
         context[key] = callable(value) and value() or value