~openerp-dev/openobject-addons/trunk-bug-986088-amb

« back to all changes in this revision

Viewing changes to event/event.py

[BACKPORT] Stable fixes and refactorings to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
            args[1]['description']= event.mail_confirm
219
219
        return super(event_registration, self).write(cr, uid, *args, **argv)
220
220
 
221
 
    def mail_user_confirm(self,cr,uid,ids):
222
 
        reg_ids=self.browse(cr,uid,ids)
 
221
    def mail_user_confirm(self, cr, uid, ids):
 
222
        reg_ids = self.browse(cr,uid,ids)
223
223
        for reg_id in reg_ids:
224
224
            src = reg_id.event_id.reply_to or False
225
 
            dest = [reg_id.email_from]
 
225
            dest = []
 
226
            if reg_id.email_from:
 
227
                dest += [reg_id.email_from]
226
228
            if reg_id.email_cc:
227
229
                dest += [reg_id.email_cc]
228
230
            if dest and src:
231
233
                raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering'))
232
234
        return False
233
235
 
234
 
    def mail_user(self,cr,uid,ids):
235
 
        reg_ids=self.browse(cr,uid,ids)
 
236
    def mail_user(self, cr, uid, ids):
 
237
        reg_ids = self.browse(cr, uid, ids)
236
238
        for reg_id in reg_ids:
237
239
            src = reg_id.event_id.reply_to or False
238
 
            dest = [reg_id.email_from]
 
240
            dest = []
 
241
            if reg_id.email_from:
 
242
                dest += [reg_id.email_from]
239
243
            if reg_id.email_cc:
240
244
                dest += [reg_id.email_cc]
241
245
            if reg_id.event_id.mail_auto_confirm or reg_id.event_id.mail_auto_registr: