def get_group_prms(document): prms = [] prms.append(IPrincipalRoleMap(core.get_application())) parent_group = getattr(document, "group", None) if parent_group: prms.append(IPrincipalRoleMap(parent_group)) assigned_groups = getattr(document, "group_assignment", list()) if assigned_groups: for group in assigned_groups: prms.append(IPrincipalRoleMap(group)) return prms
def notify_serialization_failure(template, **kw): email_settings = settings.EmailSettings(core.get_application()) recipients = [ email_settings.default_sender ] if template: body_text = template % kw else: body_text = kw.get("body") msg_event = NotificationEvent({ "recipients": recipients, "body": body_text, "subject": kw.get("subject", "Serialization Failure") }) zope.event.notify(msg_event)
def notify_serialization_failure(template, **kw): email_settings = settings.EmailSettings(core.get_application()) recipients = [email_settings.default_sender] if template: body_text = template % kw else: body_text = kw.get("body") msg_event = NotificationEvent({ "recipients": recipients, "body": body_text, "subject": kw.get("subject", "Serialization Failure") }) zope.event.notify(msg_event)