X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fjoinview.py;h=d4e4af5a249e2028491220b86a650a28b453f456;hb=refs%2Fheads%2Fonelab;hp=2add3a4fb3581b03a928a305642658d5c1cd6dcf;hpb=63c56469d22c93065f6f448d06106ad9f36a839b;p=myslice.git diff --git a/portal/joinview.py b/portal/joinview.py index 2add3a4f..d4e4af5a 100644 --- a/portal/joinview.py +++ b/portal/joinview.py @@ -9,7 +9,6 @@ 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 @@ -22,6 +21,7 @@ from portal.models import PendingUser,PendingAuthority 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 @@ -154,9 +154,12 @@ class JoinView (FreeAccessView, ThemeView): 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 = { @@ -229,9 +232,9 @@ class JoinView (FreeAccessView, ThemeView): 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