Added document_name alias for use on award certificates.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/models/role.py Thu Mar 26 13:58:13 2009 +0000
+++ b/app/soc/models/role.py Thu Mar 26 14:11:06 2009 +0000
@@ -352,3 +352,11 @@
"""Property as 'name' for use in common templates.
"""
return '%s %s' %(self.given_name, self.surname)
+
+ def document_name(self):
+ """Property as 'document_name' used on for example award certificates.
+ """
+ if self.name_on_documents:
+ return self.name_on_documents
+ else:
+ return self.name()