Formatting

This commit is contained in:
richard-dds
2018-07-30 15:33:19 -04:00
committed by dandds
parent 08243a199a
commit efdf0b04ba
5 changed files with 19 additions and 18 deletions

View File

@@ -8,12 +8,10 @@ from .exceptions import NotFoundError, AlreadyExistsError
class Users(object):
def __init__(self, db_session):
self.db_session = db_session
self.roles_repo = Roles(db_session)
def get(self, user_id):
try:
user = self.db_session.query(User).filter_by(id=user_id).one()

View File

@@ -8,8 +8,8 @@ from .roles import Roles
from .users import Users
from .exceptions import NotFoundError
class WorkspaceUsers(object):
class WorkspaceUsers(object):
def __init__(self, db_session):
self.db_session = db_session
self.roles_repo = Roles(db_session)
@@ -48,10 +48,14 @@ class WorkspaceUsers(object):
raise NotFoundError("role")
try:
existing_workspace_role = self.db_session.query(WorkspaceRole).filter(
WorkspaceRole.user == user,
WorkspaceRole.workspace_id == workspace_id,
).one()
existing_workspace_role = (
self.db_session.query(WorkspaceRole)
.filter(
WorkspaceRole.user == user,
WorkspaceRole.workspace_id == workspace_id,
)
.one()
)
new_workspace_role = existing_workspace_role
new_workspace_role.role = role
except NoResultFound:

View File

@@ -1,5 +1,4 @@
class Projects(object):
def __init__(self):
pass
@@ -47,7 +46,6 @@ class Projects(object):
class Members(object):
def __init__(self):
pass