Encode the username coming in from OAuth as so that it can be URL quoted for API calls. Strings fed into the user importer and the unit tests were already encoded, which is why this was missed.
Some user edit counts show incorrectly (usually None)
@@ -266,7 +266,7 @@ class Editor(models.Model):
editcount: 10
"""
try:
- endpoint = '{base}/w/api.php?action=query&meta=globaluserinfo&guiuser={username}&guiprop=editcount&format=json&formatversion=2'.format(base=identity['iss'],username=urllib2.quote(identity['username']))
+ endpoint = '{base}/w/api.php?action=query&meta=globaluserinfo&guiuser={username}&guiprop=editcount&format=json&formatversion=2'.format(base=identity['iss'],username=urllib2.quote(identity['username'].encode('utf8')))
results = json.loads(urllib2.urlopen(endpoint).read())
global_userinfo = results['query']['globaluserinfo']
