Add render_person_profile()
method to MasterView
This commit is contained in:
parent
9566a882b5
commit
8470126918
|
@ -897,6 +897,14 @@ class MasterView(View):
|
||||||
url = self.request.route_url('people.view', uuid=person.uuid)
|
url = self.request.route_url('people.view', uuid=person.uuid)
|
||||||
return tags.link_to(text, url)
|
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):
|
def render_user(self, obj, field):
|
||||||
user = getattr(obj, field)
|
user = getattr(obj, field)
|
||||||
if not user:
|
if not user:
|
||||||
|
|
Loading…
Reference in a new issue