-from __future__ import print_function
-
import os.path, re
import json
from random import randint
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
from portal.actions import authority_get_pi_emails, manifold_add_user,manifold_add_account, create_pending_user
from myslice.theme import ThemeView
+from myslice.settings import logger
import activity.institution
reg_password = request.POST['pi_password']
salt = randint(1,100000)
- # get the domain url
- current_site = Site.objects.get_current()
- current_site = current_site.domain
+
+ if request.is_secure():
+ current_site = 'https://'
+ else:
+ current_site = 'http://'
+ current_site += request.META['HTTP_HOST']
email_hash = md5(str(salt)+reg_email).hexdigest()
user_request = {
msg.send()
except Exception, e:
- print("Failed to send email, please check the mail templates and the SMTP configuration of your server")
+ logger.error("Failed to send email, please check the mail templates and the SMTP configuration of your server")
import traceback
- traceback.print_exc()
+ logger.error(traceback.format_exc())
self.template_name = 'join_complete.html'
# log institution activity