Changed display_name to name_on_certificates in models/role.py.
This is to make the intention of this property more clear as to display_name which would remind people of for instance nicknames or a replacement for their public name for this role.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/models/role.py Sat Jan 31 19:46:55 2009 +0000
+++ b/app/soc/models/role.py Sat Jan 31 21:32:29 2009 +0000
@@ -98,15 +98,15 @@
surname.help_text = ugettext('lower ASCII characters only')
#: Optional field used as a display name, such as for awards
- #: certificates. Should be the entire display name in the format
+ #: certificates. Should be the entire name in the format
#: the Role would like it displayed (could be surname followed by
#: given name in some cultures, for example). Display names can be
#: any valid UTF-8 text.
- display_name = db.StringProperty(
+ name_on_certificates = db.StringProperty(
verbose_name=ugettext('Display Name'))
- display_name.help_text = ugettext(
+ name_on_certificates.help_text = ugettext(
'Optional field used as a display name, such as for awards '
- 'certificates. Should be the entire display name in the format '
+ 'certificates. Should be the entire name in the format '
'the person would like it displayed (could be family name followed '
'by given name in some cultures, for example). Display names can be '
'any valid UTF-8 text.')
@@ -306,6 +306,9 @@
def name(self):
- """Alias 'display_name' Property as 'name' for use in common templates.
+ """Property as 'name' for use in common templates.
"""
- return self.display_name
+ if self.name_on_certificates:
+ return self.name_on_certificates
+ else:
+ return '%s %s' (self.given_name, self.surname)
--- a/app/soc/templates/soc/club_admin/public.html Sat Jan 31 19:46:55 2009 +0000
+++ b/app/soc/templates/soc/club_admin/public.html Sat Jan 31 21:32:29 2009 +0000
@@ -22,7 +22,7 @@
<p>
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
- {% readonly_field_as_table_row entity.fields.display_name.label entity.display_name %}
+ {% readonly_field_as_table_row entity.fields.name_on_certificates.label entity.name_on_certificates %}
{% readonly_field_as_table_row entity.fields.im_handle.label entity.im_handle %}
{% readonly_field_as_table_row entity.fields.res_country.label entity.res_country %}
</table>
--- a/app/soc/templates/soc/club_member/public.html Sat Jan 31 19:46:55 2009 +0000
+++ b/app/soc/templates/soc/club_member/public.html Sat Jan 31 21:32:29 2009 +0000
@@ -22,7 +22,7 @@
<p>
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
- {% readonly_field_as_table_row entity.fields.display_name.label entity.display_name %}
+ {% readonly_field_as_table_row entity.fields.name_on_certificates.label entity.name_on_certificates %}
{% readonly_field_as_table_row entity.fields.im_handle.label entity.im_handle %}
{% readonly_field_as_table_row entity.fields.res_country.label entity.res_country %}
</table>
--- a/app/soc/templates/soc/host/public.html Sat Jan 31 19:46:55 2009 +0000
+++ b/app/soc/templates/soc/host/public.html Sat Jan 31 21:32:29 2009 +0000
@@ -23,7 +23,7 @@
<table>
{% readonly_field_as_table_row entity.fields.given_name.label entity.given_name %}
{% readonly_field_as_table_row entity.fields.surname.label entity.surname %}
- {% readonly_field_as_table_row entity.fields.display_name.label entity.display_name %}
+ {% readonly_field_as_table_row entity.fields.name_on_certificates.label entity.name_on_certificates %}
<!-- TODO(pawel.solyga) make this generic -->
</table>
</p>
--- a/app/soc/templates/soc/mentor/public.html Sat Jan 31 19:46:55 2009 +0000
+++ b/app/soc/templates/soc/mentor/public.html Sat Jan 31 21:32:29 2009 +0000
@@ -22,7 +22,7 @@
<p>
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
- {% readonly_field_as_table_row entity.fields.display_name.label entity.display_name %}
+ {% readonly_field_as_table_row entity.fields.name_on_certificates.label entity.name_on_certificates %}
{% readonly_field_as_table_row entity.fields.im_handle.label entity.im_handle %}
{% readonly_field_as_table_row entity.fields.res_country.label entity.res_country %}
</table>
--- a/app/soc/templates/soc/org_admin/public.html Sat Jan 31 19:46:55 2009 +0000
+++ b/app/soc/templates/soc/org_admin/public.html Sat Jan 31 21:32:29 2009 +0000
@@ -22,7 +22,7 @@
<p>
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
- {% readonly_field_as_table_row entity.fields.display_name.label entity.display_name %}
+ {% readonly_field_as_table_row entity.fields.name_on_certificates.label entity.name_on_certificates %}
{% readonly_field_as_table_row entity.fields.im_handle.label entity.im_handle %}
{% readonly_field_as_table_row entity.fields.res_country.label entity.res_country %}
</table>