Changeset View
Changeset View
Standalone View
Standalone View
wallace/module_invitationpolicy.py
Show First 20 Lines • Show All 1,278 Lines • ▼ Show 20 Lines | def send_update_notification(object, receiving_user, old=None, reply=True, sender=None, comment=None): | ||||
msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') | msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') | ||||
msg['To'] = receiving_user['mail'] | msg['To'] = receiving_user['mail'] | ||||
msg['Date'] = formatdate(localtime=True) | msg['Date'] = formatdate(localtime=True) | ||||
msg['Subject'] = utils.str2unicode(_('"%s" has been updated') % (object.get_summary())) | msg['Subject'] = utils.str2unicode(_('"%s" has been updated') % (object.get_summary())) | ||||
msg['From'] = Header(utils.str2unicode('%s' % orgname) if orgname else '') | msg['From'] = Header(utils.str2unicode('%s' % orgname) if orgname else '') | ||||
msg['From'].append("<%s>" % orgemail) | msg['From'].append("<%s>" % orgemail) | ||||
modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) | success = modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) | ||||
machniak: A typo here, you've cut `m` | |||||
log.debug(_("Sent update notification to %r: %r") % (receiving_user['mail'], success), level=8) | log.debug(_("Sent update notification to %r: %r") % (receiving_user['mail'], success), level=8) | ||||
def send_cancel_notification(object, receiving_user, deleted=False, sender=None, comment=None): | def send_cancel_notification(object, receiving_user, deleted=False, sender=None, comment=None): | ||||
""" | """ | ||||
Send a notification about event/task cancellation | Send a notification about event/task cancellation | ||||
""" | """ | ||||
import smtplib | import smtplib | ||||
from email.MIMEText import MIMEText | from email.MIMEText import MIMEText | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | def send_cancel_notification(object, receiving_user, deleted=False, sender=None, comment=None): | ||||
msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') | msg = MIMEText(utils.stripped_message(message_text), _charset='utf-8') | ||||
msg['To'] = receiving_user['mail'] | msg['To'] = receiving_user['mail'] | ||||
msg['Date'] = formatdate(localtime=True) | msg['Date'] = formatdate(localtime=True) | ||||
msg['Subject'] = utils.str2unicode(_('"%s" has been cancelled') % (object.get_summary())) | msg['Subject'] = utils.str2unicode(_('"%s" has been cancelled') % (object.get_summary())) | ||||
msg['From'] = Header(utils.str2unicode('%s' % orgname) if orgname else '') | msg['From'] = Header(utils.str2unicode('%s' % orgname) if orgname else '') | ||||
msg['From'].append("<%s>" % orgemail) | msg['From'].append("<%s>" % orgemail) | ||||
modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) | success = modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) | ||||
log.debug(_("Sent cancel notification to %r: %r") % (receiving_user['mail'], success), level=8) | log.debug(_("Sent cancel notification to %r: %r") % (receiving_user['mail'], success), level=8) | ||||
def is_auto_reply(user, sender_email, type): | def is_auto_reply(user, sender_email, type): | ||||
accept_available = False | accept_available = False | ||||
accept_conflicts = False | accept_conflicts = False | ||||
for policy in get_matching_invitation_policies(user, sender_email, object_type_conditons.get(type, COND_TYPE_EVENT)): | for policy in get_matching_invitation_policies(user, sender_email, object_type_conditons.get(type, COND_TYPE_EVENT)): | ||||
if policy & (ACT_ACCEPT | ACT_REJECT | ACT_DELEGATE): | if policy & (ACT_ACCEPT | ACT_REJECT | ACT_DELEGATE): | ||||
if check_policy_condition(policy, True): | if check_policy_condition(policy, True): | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
A typo here, you've cut m