Added document_name alias for use on award certificates.
authorLennard de Rijk <ljvderijk@gmail.com>
Thu, 26 Mar 2009 14:11:06 +0000
changeset 2017 bde6efa3df3f
parent 2016 01e3adf37176
child 2018 c584eb2f57db
Added document_name alias for use on award certificates. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/models/role.py
--- 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()