forked from ScoDoc/ScoDoc
updated email imports
This commit is contained in:
parent
415810496f
commit
31c40b6492
@ -45,8 +45,8 @@ import traceback
|
|||||||
|
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
from email.mime.base import MIMEBase
|
|
||||||
from email.header import Header
|
from email.header import Header
|
||||||
|
from email.mime.base import MIMEBase
|
||||||
|
|
||||||
from sco_zope import (
|
from sco_zope import (
|
||||||
ObjectManager,
|
ObjectManager,
|
||||||
|
@ -39,8 +39,7 @@ TITLES = ("user_name", "nom", "prenom", "email", "roles", "dept")
|
|||||||
|
|
||||||
|
|
||||||
def generate_excel_sample():
|
def generate_excel_sample():
|
||||||
"""generates an excel document suitable to import users
|
"""generates an excel document suitable to import users"""
|
||||||
"""
|
|
||||||
style = sco_excel.Excel_MakeStyle(bold=True)
|
style = sco_excel.Excel_MakeStyle(bold=True)
|
||||||
titles = TITLES
|
titles = TITLES
|
||||||
titlesStyles = [style] * len(titles)
|
titlesStyles = [style] * len(titles)
|
||||||
@ -105,7 +104,7 @@ def import_users(U, auth_dept="", context=None):
|
|||||||
- créer utilisateur et mettre le mot de passe
|
- créer utilisateur et mettre le mot de passe
|
||||||
- envoyer mot de passe par mail
|
- envoyer mot de passe par mail
|
||||||
|
|
||||||
En cas d'erreur: supprimer tous les utilisateurs que l'on vient de créer.
|
En cas d'erreur: supprimer tous les utilisateurs que l'on vient de créer.
|
||||||
"""
|
"""
|
||||||
created = [] # liste de uid créés
|
created = [] # liste de uid créés
|
||||||
try:
|
try:
|
||||||
@ -164,11 +163,11 @@ def generate_password():
|
|||||||
return "".join(RNG.sample(l, PASSLEN))
|
return "".join(RNG.sample(l, PASSLEN))
|
||||||
|
|
||||||
|
|
||||||
from email.MIMEMultipart import MIMEMultipart
|
import email
|
||||||
from email.MIMEText import MIMEText
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.MIMEBase import MIMEBase
|
from email.mime.text import MIMEText
|
||||||
from email.Header import Header
|
from email.mime.base import MIMEBase
|
||||||
from email import Encoders
|
from email.header import Header
|
||||||
|
|
||||||
|
|
||||||
def mail_password(u, context=None, reset=False):
|
def mail_password(u, context=None, reset=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user