Changeset 13963 for main/waeup.aaue/trunk/src/waeup/aaue/utils
- Timestamp:
- 21 Jun 2016, 06:30:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py
r13870 r13963 18 18 """Customize general helper utilities for Kofa. 19 19 """ 20 21 import string 20 22 from kofacustom.nigeria.utils.utils import NigeriaKofaUtils 21 23 … … 161 163 'Institute of Education': ('dp_ft'), 162 164 } 165 166 def fullname(self, firstname, lastname, middlename=None): 167 """Construct fullname. 168 """ 169 try: 170 lastname = lastname.upper() 171 except AttributeError: 172 pass 173 # We do not necessarily have the middlename attribute 174 if middlename: 175 givennames = '%s %s' % (firstname, middlename) 176 else: 177 givennames = '%s' % firstname 178 givennames = string.capwords( 179 givennames.replace('-', ' - ')).replace(' - ', '-') 180 fullname = '%s, %s' % (lastname, givennames) 181 if '<' in fullname: 182 return 'XXX' 183 return fullname
Note: See TracChangeset for help on using the changeset viewer.