some cleanup for invitation changes
This commit is contained in:
parent
faa98fcb17
commit
3a5d8036a1
@ -32,12 +32,3 @@ class WorkspacesQuery(Query):
|
||||
@classmethod
|
||||
def create_workspace_role(cls, user, role, workspace, **kwargs):
|
||||
return WorkspaceRole(user=user, role=role, workspace=workspace, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def get_role_for_workspace_and_user(cls, workspace, user):
|
||||
return (
|
||||
db.session.query(WorkspaceRole)
|
||||
.filter(WorkspaceRole.user == user)
|
||||
.filter(WorkspaceRole.workspace == workspace)
|
||||
.one()
|
||||
)
|
||||
|
@ -41,8 +41,8 @@ class Invitation(Base, TimestampsMixin, AuditableMixin):
|
||||
token = Column(String(), index=True, default=lambda: secrets.token_urlsafe())
|
||||
|
||||
def __repr__(self):
|
||||
return "<Invitation(user='{}', workspace='{}', id='{}')>".format(
|
||||
self.user.id, self.workspace.id, self.id
|
||||
return "<Invitation(user='{}', workspace_role='{}', id='{}')>".format(
|
||||
self.user_id, self.workspace_role_id, self.id
|
||||
)
|
||||
|
||||
@property
|
||||
|
@ -44,7 +44,7 @@ def make_error_pages(app):
|
||||
|
||||
@app.errorhandler(InvitationError)
|
||||
# pylint: disable=unused-variable
|
||||
def expired_invitation(e):
|
||||
def invalid_invitation(e):
|
||||
log_error(e)
|
||||
return (
|
||||
render_template(
|
||||
|
Loading…
x
Reference in New Issue
Block a user