Changeset 1175 in main


Ignore:
Timestamp:
06/06/12 08:27:36 (7 years ago)
Author:
zali
Message:

send_mail: cancel last commit

Location:
trunk/openPLM/plmapp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/mail.py

    r1174 r1175  
    3232 
    3333from django.conf import settings 
    34 from django.utils import translation 
    35 from django.utils.translation import ugettext_lazy as _ 
    3634from django.core.mail import EmailMultiAlternatives 
    3735from django.db.models import Model, Q 
     
    167165def do_send_mail(subject, recipients, ctx, template, blacklist=()): 
    168166    if recipients: 
    169         ctx = unserialize(ctx) 
    170         language=ctx["sponsor"].get_profile().language 
    171167        if len(recipients) == 1: 
    172             r_id = recipients.pop() 
    173             language = User.objects.get(id=r_id).get_profile().language 
    174             email = User.objects.get(id=r_id).email 
     168            email = User.objects.get(id=recipients.pop()).email 
    175169            if not email or email in blacklist: 
    176170                return 
     
    182176            if not emails: 
    183177                return 
    184  
     178        ctx = unserialize(ctx) 
    185179        ctx["site"] = Site.objects.get_current() 
    186         translation.activate(language) 
    187         html_content =translation.gettext(render_to_string(template + ".html", ctx)) 
    188         message = translation.gettext(render_to_string(template + ".txt", ctx)) 
     180        html_content =render_to_string(template + ".html", ctx) 
     181        message = render_to_string(template + ".txt", ctx) 
    189182        msg = EmailMultiAlternatives(subject, message, settings.EMAIL_OPENPLM, 
    190183            emails) 
  • trunk/openPLM/plmapp/views/main.py

    r1173 r1175  
    18771877            importer = Importer(csv_file, request.user, encoding) 
    18781878            preview = importer.get_preview() 
    1879             print preview.rows 
    18801879        if request.method == "POST": 
    18811880            headers_formset = Formset(request.POST) 
Note: See TracChangeset for help on using the changeset viewer.