Commit 2b16c157 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Minor change in the user activation procedure

parent 3d22b4e6
......@@ -374,9 +374,14 @@ def user_login(request):
def user_activation_notify(user):
current_site = Site.objects.get_current()
peer = user.get_profile().peer
# Email subject *must not* contain newlines
# TechCs will be notified about new users.
# Platform admins will activate the users.
subject = render_to_string('registration/activation_email_subject.txt',
{ 'site': current_site })
# Email subject *must not* contain newlines
subject = ''.join(subject.splitlines())
registration_profile = RegistrationProfile.objects.create_profile(user)
message = render_to_string('registration/activation_email.txt',
......@@ -384,6 +389,20 @@ def user_activation_notify(user):
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
'site': current_site,
'user': user })
admin_mails = settings.NOTIFY_ADMIN_MAILS
send_new_mail(settings.EMAIL_SUBJECT_PREFIX + subject,
message, settings.SERVER_EMAIL,
admin_mails, [])
# Mail to domain techCs plus platform admins (no activation hash sent)
subject = render_to_string('registration/activation_email_peer_notify_subject.txt',
{ 'site': current_site,
'peer': peer })
subject = ''.join(subject.splitlines())
message = render_to_string('registration/activation_email_peer_notify.txt',
{ 'user': user,
'peer': peer })
send_new_mail(settings.EMAIL_SUBJECT_PREFIX + subject,
message, settings.SERVER_EMAIL,
get_peer_techc_mails(user), [])
......@@ -495,7 +514,6 @@ def get_peer_techc_mails(user):
additional_mail = settings.NOTIFY_ADMIN_MAILS
# mail.extend(user_mail)
return mail
Ο/H {{ user.get_full_name }} έκανε αίτηση για νεό λογαριασμό στην υπηρεσία Firewall On Demand
εκ μέρους του ιδρύματος/φορέα: {{peer}}.
Όνομα χρήστη: {{ user.username }}
E-mail: {{ }}
Ο χρήστης θα ενημερωθεί για την ενεργοποίηση του λογαριασμού του μέσω e-mail.
Σε περίπτωση που ο χρήστης δεν ανήκει στο ίδρυμα/φορέα σας ή χρησιμοποιεί την υπηρεσία ενάντια στον
εσωτερικό σας κανονισμό παρακαλούμε επικοινωνήστε άμεσα μαζί μας.
{{ user.get_full_name }} has registered for a new Firewall on Demand account on behalf of your
institution: {{peer}}.
Username: {{user.username}}
E-mail: {{}}
The user will be notified via mail about the account activation
In case this user does not belong to your institution or attempts to use the service without being
compliant to your instututions' regulation please contact us.
GRNET Firewall on Demand new account registration at {{ }} on behalf of {{peer}}
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