Ejemplo n.º 1
0
    def invite_members(self, emails, application_url):
        """Invite somebody to this board,

        Create token used in invitation email.
        Store email in pending list.

        Params:
            - ``emails`` -- list of emails
        """
        for email in set(emails):
            # If user already exists add it to the board directly or invite it otherwise
            invitation = forms.EmailInvitation(self.app_title, self.app_banner,
                                               self.theme, email,
                                               security.get_user().data,
                                               self.data, application_url)
            invitation.send_email(self.mail_sender)
Ejemplo n.º 2
0
    def resend_invitation(self, pending_member, application_url):
        """Resend an invitation,

        Resend invitation to the pending member

        In:
            - ``pending_member`` -- Send invitation to this user (PendingMember instance)
        """
        email = pending_member.username
        invitation = forms.EmailInvitation(self.app_title, self.app_banner,
                                           self.theme, email,
                                           security.get_user().data, self.data,
                                           application_url)
        invitation.send_email(self.mail_sender)
        # re-calculate pending
        self.pending = [
            component.Component(
                BoardMember(PendingUser(token.token), self, "pending"))
            for token in set(self.data.pending)
        ]