Add render_person_profile() method to MasterView

This commit is contained in:
Lance Edgar 2022-08-18 19:22:04 -05:00
parent 9566a882b5
commit 8470126918

View file

@ -897,6 +897,14 @@ class MasterView(View):
url = self.request.route_url('people.view', uuid=person.uuid)
return tags.link_to(text, url)
def render_person_profile(self, obj, field):
person = getattr(obj, field)
if not person:
return ""
text = six.text_type(person)
url = self.request.route_url('people.view_profile', uuid=person.uuid)
return tags.link_to(text, url)
def render_user(self, obj, field):
user = getattr(obj, field)
if not user: