From a6e515dfe8f07410e7c71fa826995e5172b19731 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 1 Jul 2020 18:35:17 -0700 Subject: lint (flake8) web interface python files --- python/fatcat_web/auth.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'python/fatcat_web/auth.py') diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py index 8e26b7fe..268bc1c4 100644 --- a/python/fatcat_web/auth.py +++ b/python/fatcat_web/auth.py @@ -2,8 +2,7 @@ from collections import namedtuple import requests import pymacaroons -from flask import Flask, render_template, send_from_directory, request, \ - url_for, abort, g, redirect, jsonify, session, flash +from flask import render_template, abort, redirect, session, flash from flask_login import logout_user, login_user, UserMixin from fatcat_web import login_manager, app, api, priv_api, Config import fatcat_openapi_client -- cgit v1.2.3 From ecd9359833ea83e8422ddb7496853719ca83cb21 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 9 Jul 2020 00:29:49 -0700 Subject: get mediawiki username creation working with spaces --- python/fatcat_web/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/fatcat_web/auth.py') diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py index 268bc1c4..ed9f2252 100644 --- a/python/fatcat_web/auth.py +++ b/python/fatcat_web/auth.py @@ -140,8 +140,9 @@ def handle_wmoauth(username): # pass off "as if" we did OAuth successfully FakeOAuthRemote = namedtuple('FakeOAuthRemote', ['name', 'OAUTH_CONFIG']) remote = FakeOAuthRemote(name='wikipedia', OAUTH_CONFIG={'api_base_url': "https://www.mediawiki.org/w"}) + conservative_username = ''.join(filter(str.isalnum, username)) oauth_info = { - 'preferred_username': username, + 'preferred_username': conservative_username, 'iss': "https://www.mediawiki.org/w", 'sub': username, } -- cgit v1.2.3