Milimetric has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74661


Change subject: hopefully the last cohorts upload fix
......................................................................

hopefully the last cohorts upload fix

Change-Id: I8c645e76dcd91d3b78f34afbaab5e970db01af13
---
M wikimetrics/controllers/cohorts.py
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics 
refs/changes/61/74661/1

diff --git a/wikimetrics/controllers/cohorts.py 
b/wikimetrics/controllers/cohorts.py
index b3a7b8c..10fe64b 100644
--- a/wikimetrics/controllers/cohorts.py
+++ b/wikimetrics/controllers/cohorts.py
@@ -280,10 +280,7 @@
 
 
 def parse_username(raw_username):
-    stripped = str(raw_username).decode('utf8').strip()
-    # unfortunately .title() or .capitalize() don't work
-    # because 'miliMetric'.capitalize() == 'Milimetric'
-    return stripped[0].upper() + stripped[1:]
+    return str(raw_username).decode('utf8').strip()
 
 
 def normalize_project(project):
@@ -327,6 +324,11 @@
 
 
 def normalize_user(user_str, project):
+    # Capitalize the username according to the Mediawiki standard
+    # NOTE: unfortunately .title() or .capitalize() don't work
+    # because 'miliMetric'.capitalize() == 'Milimetric'
+    user_str = user_str[0].upper() + user_str[1:]
+    
     wikiuser = get_wikiuser_by_name(user_str, project)
     if wikiuser is not None:
         return (wikiuser.user_id, wikiuser.user_name)

-- 
To view, visit https://gerrit.wikimedia.org/r/74661
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c645e76dcd91d3b78f34afbaab5e970db01af13
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Milimetric <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to