Resend workspace invitations to email submitted in new member form.

This commit is contained in:
leigh-mil
2018-11-19 17:21:35 -05:00
parent 3c154f445c
commit 385878e1ab
7 changed files with 97 additions and 19 deletions

View File

@@ -42,11 +42,13 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
expiration_time = Column(TIMESTAMP(timezone=True))
token = Column(String(), index=True, default=lambda: secrets.token_urlsafe())
token = Column(String, index=True, default=lambda: secrets.token_urlsafe())
email = Column(String, nullable=False)
def __repr__(self):
return "<Invitation(user='{}', workspace_role='{}', id='{}')>".format(
self.user_id, self.workspace_role_id, self.id
return "<Invitation(user='{}', workspace_role='{}', id='{}', email='{}')>".format(
self.user_id, self.workspace_role_id, self.id, self.email
)
@property
@@ -82,10 +84,6 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
if self.workspace_role:
return self.workspace_role.workspace
@property
def user_email(self):
return self.workspace_role.user.email
@property
def user_name(self):
return self.workspace_role.user.full_name