New invitation backend for portfolio invitations.
Portfolio invitations do not associate a user entity until the invitation has been accepted. User info, including DOD ID, is held on the invitation itself. When a user accepts and invitation, their user entry is associated with the corresponding `portfolio_role` entry. The same change will be applied to `application_role` and application invitations. For now, small changes have been made to application-related methods so that that flow works as-is.
This commit is contained in:
@@ -97,7 +97,7 @@ class InvitesMixin(object):
|
||||
|
||||
@property
|
||||
def user_name(self):
|
||||
return self.role.user.full_name
|
||||
return "{} {}".format(self.first_name, self.last_name)
|
||||
|
||||
@property
|
||||
def is_revokable(self):
|
||||
|
@@ -116,7 +116,14 @@ class PortfolioRole(
|
||||
|
||||
@property
|
||||
def user_name(self):
|
||||
return self.user.full_name
|
||||
if self.user:
|
||||
return self.user.full_name
|
||||
else:
|
||||
return self.latest_invitation.user_name
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
return self.user_name
|
||||
|
||||
@property
|
||||
def is_active(self):
|
||||
@@ -128,10 +135,6 @@ class PortfolioRole(
|
||||
self.latest_invitation and self.latest_invitation.is_inactive
|
||||
)
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
return self.user.full_name
|
||||
|
||||
@property
|
||||
def application_id(self):
|
||||
return None
|
||||
|
Reference in New Issue
Block a user