Update portfolio_invitation.py

This commit is contained in:
zandercymatics 2024-11-14 14:01:15 -07:00
parent bf585bec2a
commit 0ca0602b07
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -67,20 +67,6 @@ class PortfolioInvitation(TimeStampedModel):
protected=True, # can't alter state except through transition methods!
)
# TODO - replace this with a "creator" field on portfolio invitation. This should be another ticket.
@property
def creator(self):
"""Get the user who created this invitation from the audit log"""
content_type = ContentType.objects.get_for_model(self)
log_entry = LogEntry.objects.filter(
content_type=content_type,
object_id=self.pk,
action_flag=ADDITION
).order_by("action_time").first()
return log_entry.user if log_entry else None
def __str__(self):
return f"Invitation for {self.email} on {self.portfolio} is {self.status}"