Email: Dynamically add domain of the portal in email
[unfold.git] / portal / registrationview.py
index 396d357..a4b5fd5 100644 (file)
@@ -6,6 +6,7 @@ from django.views.generic       import View
 from django.template.loader     import render_to_string
 from django.shortcuts           import render
 from django.contrib.auth        import get_user_model
+from django.contrib.sites.models import Site
 
 from unfold.page                import Page
 from unfold.loginrequired       import FreeAccessView
@@ -49,6 +50,10 @@ class RegistrationView (FreeAccessView, ThemeView):
 
         if method == 'POST':
             # The form has been submitted
+            
+            # get the domain url
+            current_site = Site.objects.get_current()
+            current_site = current_site.domain
 
             user_request = {
                 'first_name'    : wsgi_request.POST.get('firstname',     ''),
@@ -56,6 +61,7 @@ class RegistrationView (FreeAccessView, ThemeView):
                 'authority_hrn' : wsgi_request.POST.get('authority_hrn', ''),
                 'email'         : wsgi_request.POST.get('email',         '').lower(),
                 'password'      : wsgi_request.POST.get('password',      ''),
+                'current_site'  : current_site
             }
 
             # Construct user_hrn from email (XXX Should use common code)