|
|
@ -188,18 +188,16 @@ def createUser(request): |
|
|
email = EmailMultiAlternatives( |
|
|
email = EmailMultiAlternatives( |
|
|
"Bienvenue à l'association Coopé Technopôle Metz", |
|
|
"Bienvenue à l'association Coopé Technopôle Metz", |
|
|
text_content, |
|
|
text_content, |
|
|
"Coopé Technopôle Metz <no-reply@coope.rezometz.org>", |
|
|
"Coopé Technopôle Metz <no-reply-coope@rezometz.org>", |
|
|
[user.email], |
|
|
[user.email], |
|
|
reply_to=["coopemetz@gmail.com"] |
|
|
reply_to=["coopemetz@gmail.com"] |
|
|
) |
|
|
) |
|
|
email.attach_alternative(html_content, "text/html") |
|
|
email.attach_alternative(html_content, "text/html") |
|
|
gp,_ = GeneralPreferences.objects.get_or_create(pk=1) |
|
|
gp,_ = GeneralPreferences.objects.get_or_create(pk=1) |
|
|
if gp.statutes: |
|
|
if gp.statutes: |
|
|
#email.attach("statuts.pdf", gp.statutes.read(), "application/pdf") |
|
|
email.attach("statuts.pdf", gp.statutes.read(), "application/pdf") |
|
|
pass |
|
|
|
|
|
if gp.rules: |
|
|
if gp.rules: |
|
|
#email.attach("ri.pdf", gp.rules.read(), "application/pdf") |
|
|
email.attach("ri.pdf", gp.rules.read(), "application/pdf") |
|
|
pass |
|
|
|
|
|
email.send() |
|
|
email.send() |
|
|
messages.success(request, "L'utilisateur a bien été créé") |
|
|
messages.success(request, "L'utilisateur a bien été créé") |
|
|
return redirect(reverse('users:profile', kwargs={'pk':user.pk})) |
|
|
return redirect(reverse('users:profile', kwargs={'pk':user.pk})) |
|
|
|