populate wikihomepage in dddatabuilder.py
This commit is contained in:
parent
4450a7ccfd
commit
4782b64f06
1 changed files with 8 additions and 0 deletions
|
@ -22,12 +22,15 @@
|
|||
#
|
||||
"""This file contains code to build a representation of a person based
|
||||
on keyring data associated to a given email address."""
|
||||
import logging
|
||||
from ddportfolioservice.model import keyfinder
|
||||
|
||||
TYPE_NO = 0
|
||||
TYPE_DM = 1
|
||||
TYPE_DD = 2
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def build_data(email_address):
|
||||
"""Build a DD data structure from a given email address."""
|
||||
|
@ -43,4 +46,9 @@ def build_data(email_address):
|
|||
fields['type'] = TYPE_DM
|
||||
else:
|
||||
fields['type'] = TYPE_NO
|
||||
if fields['name']:
|
||||
log.debug('generate wikihomepage from name')
|
||||
fields['wikihomepage'] = "".join(
|
||||
[part.capitalize() for part in fields['name'].split()])
|
||||
|
||||
return fields
|
||||
|
|
Loading…
Reference in a new issue