def invite_members_js(self, group): if hasattr(self, 'form_result'): emails = self.form_result.get('emails', '') valid, invalid = extract_emails(emails) message = self.form_result['message'] self._send_group_invitations(group, valid, message) return {'success': True}
def invite_members(self, group): """Invite new members to the group.""" if hasattr(self, 'form_result'): emails = self.form_result.get('emails', '') valid, invalid = extract_emails(emails) self._send_group_invitations(group, valid) if invalid != []: h.flash(_("Invalid email addresses detected: %s") % ', '.join(invalid)) if request.referrer: redirect(request.referrer) else: redirect(url(controller='group', action='home', id=group.group_id))
def invite_members_step(self, group): if hasattr(self, 'form_result'): emails = self.form_result.get('emails', '') valid, invalid = extract_emails(emails) self._send_group_invitations(group, valid) if invalid != []: h.flash(_("Invalid email addresses detected: %s") % ', '.join(invalid)) if self.form_result.get('final_submit') is not None: redirect(group.url(action='welcome')) else: redirect(group.url(action='invite_members_step')) return render('group/members_step.mako')