Commit 3647b2a6 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

call ``send_greeting`` from ``switch_account_to_shibboleth`` instead of ``activate`` view

parent 90f1762d
......@@ -246,7 +246,7 @@ def activate(user, email_template_name='im/welcome_email.txt',
send_helpdesk_notification(user, helpdesk_email_template_name)
send_greeting(user, email_template_name)
def switch_account_to_shibboleth(user, local_user):
def switch_account_to_shibboleth(user, local_user, greeting_template_name='im/welcome_email.txt'):
if not user or not isinstance(user, AstakosUser):
return
......@@ -261,6 +261,7 @@ def switch_account_to_shibboleth(user, local_user):
local_user.set_unusable_password()
local_user.third_party_identifier = user.third_party_identifier
local_user.save()
send_greeting(local_user, greeting_template_name)
return local_user
def invite(invitation, inviter, email_template_name='im/welcome_email.txt'):
......
......@@ -473,8 +473,7 @@ def activate(request, email_template_name='im/welcome_email.txt', helpdesk_email
return index(request)
else:
try:
user = switch_account_to_shibboleth(user, local_user)
send_greeting(user, email_template_name)
user = switch_account_to_shibboleth(user, local_user, email_template_name)
response = prepare_response(request, user, next, renew=True)
transaction.commit()
return response
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment