New backend flow for application invitations.
Like portfolio invitations, now a user is not associated with an application role until they accept the associated invitation. - domain method for inviting user to application - change application route for inviting a member - ApplicationRole model knows user name from invitation
This commit is contained in:
@@ -59,12 +59,17 @@ class ApplicationRole(
|
||||
),
|
||||
)
|
||||
|
||||
@property
|
||||
def latest_invitation(self):
|
||||
if self.invitations:
|
||||
return self.invitations[-1]
|
||||
|
||||
@property
|
||||
def user_name(self):
|
||||
if self.user:
|
||||
return self.user.full_name
|
||||
else:
|
||||
return None
|
||||
elif self.latest_invitation:
|
||||
return self.latest_invitation.user_name
|
||||
|
||||
def __repr__(self):
|
||||
return "<ApplicationRole(application='{}', user_id='{}', id='{}', permissions={})>".format(
|
||||
|
Reference in New Issue
Block a user