Simplify User model string serialization.
There was a leftover method listing all the portfolios a user has access to inside the string-serialization for the User. This is too verbose. The leftover method was not being used anywhere else, so it was removed.
This commit is contained in:
parent
dfb4536b5d
commit
e259e7e440
@ -4,7 +4,6 @@ from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.event import listen
|
||||
|
||||
from atst.models import Base, ApplicationRole, types, mixins
|
||||
from atst.models.permissions import Permissions
|
||||
from atst.models.portfolio_invitation import PortfolioInvitation
|
||||
from atst.models.application_invitation import ApplicationInvitation
|
||||
from atst.models.mixins.auditable import (
|
||||
@ -97,10 +96,6 @@ class User(
|
||||
def full_name(self):
|
||||
return "{} {}".format(self.first_name, self.last_name)
|
||||
|
||||
@property
|
||||
def has_portfolios(self):
|
||||
return (Permissions.VIEW_PORTFOLIO in self.permissions) or self.portfolio_roles
|
||||
|
||||
@property
|
||||
def displayname(self):
|
||||
return self.full_name
|
||||
@ -114,8 +109,8 @@ class User(
|
||||
return None
|
||||
|
||||
def __repr__(self):
|
||||
return "<User(name='{}', dod_id='{}', email='{}', has_portfolios='{}', id='{}')>".format(
|
||||
self.full_name, self.dod_id, self.email, self.has_portfolios, self.id
|
||||
return "<User(name='{}', dod_id='{}', email='{}', id='{}')>".format(
|
||||
self.full_name, self.dod_id, self.email, self.id
|
||||
)
|
||||
|
||||
def to_dictionary(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user