Only force first letter of fullname to be upper
This change enforce the first and last component of a fullname to start with an uppercase letter. This is to keep user's custom capitalisation such as: * middle name should be lower-case * keep in-middle uppercase such as "McGinnis" Change-Id: Ifdad9f05c0d74d18396e9b06bd57c1c0f391be8d
This commit is contained in:
parent
54c26df7d8
commit
d461c157af
@ -13,7 +13,7 @@ Ocata PTL Candidates
|
|||||||
|
|
||||||
* Cinder
|
* Cinder
|
||||||
|
|
||||||
* `Sean Mcginnis (smcginnis) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Cinder/smcginnis.txt>`_
|
* `Sean McGinnis (smcginnis) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Cinder/smcginnis.txt>`_
|
||||||
|
|
||||||
* Cloudkitty
|
* Cloudkitty
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ Ocata PTL Candidates
|
|||||||
|
|
||||||
* Keystone
|
* Keystone
|
||||||
|
|
||||||
* `Samuel De Medeiros Queiroz (samueldmq) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Keystone/samueldmq.txt>`_
|
* `Samuel de Medeiros Queiroz (samueldmq) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Keystone/samueldmq.txt>`_
|
||||||
* `Steve Martinelli (stevemar) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Keystone/stevemar.txt>`_
|
* `Steve Martinelli (stevemar) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Keystone/stevemar.txt>`_
|
||||||
|
|
||||||
* Kolla
|
* Kolla
|
||||||
|
@ -15,7 +15,7 @@ Ocata PTL
|
|||||||
|
|
||||||
* Cinder
|
* Cinder
|
||||||
|
|
||||||
* `Sean Mcginnis (smcginnis) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Cinder/smcginnis.txt>`_
|
* `Sean McGinnis (smcginnis) <https://git.openstack.org/cgit/openstack/election/plain/candidates/ocata/Cinder/smcginnis.txt>`_
|
||||||
|
|
||||||
* Cloudkitty
|
* Cloudkitty
|
||||||
|
|
||||||
|
@ -102,8 +102,14 @@ def get_fullname(filepath):
|
|||||||
# Strip double space and trailing spaces
|
# Strip double space and trailing spaces
|
||||||
fullname = re.sub(r" ", " ", fullname).strip()
|
fullname = re.sub(r" ", " ", fullname).strip()
|
||||||
|
|
||||||
# Return capitalized name
|
# Make sure first letter of first and last component are upper-case
|
||||||
return u" ".join(map(unicode.capitalize, fullname.split()))
|
s = fullname.split()
|
||||||
|
fullname = (
|
||||||
|
[s[0][0].upper() + s[0][1:]] +
|
||||||
|
s[1:-1] +
|
||||||
|
[s[-1][0].upper() + s[-1][1:]]
|
||||||
|
)
|
||||||
|
return u" ".join(fullname)
|
||||||
|
|
||||||
|
|
||||||
def get_reviews(query):
|
def get_reviews(query):
|
||||||
|
Loading…
Reference in New Issue
Block a user