aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-10-13 16:46:23 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-10-13 16:47:14 -0700
commitb9d2e62d9253af5bdafeef77f242682c0a951184 (patch)
tree5295dbfda091b7d7a924999609e9ade9cd238cee /python/fatcat_web
parent316b25455a6fc96023ac8457ec53fad3777d79af (diff)
downloadfatcat-b9d2e62d9253af5bdafeef77f242682c0a951184.tar.gz
fatcat-b9d2e62d9253af5bdafeef77f242682c0a951184.zip
web: editor username /u/<username> helper
Diffstat (limited to 'python/fatcat_web')
-rw-r--r--python/fatcat_web/routes.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 41027710..e9741b6d 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -606,6 +606,14 @@ def editor_annotations(ident):
return render_template('editor_annotations.html', editor=editor,
annotations=annotations)
+@app.route('/u/<string:username>', methods=['GET', 'HEAD'])
+def editor_username_redirect(username):
+ try:
+ editor = api.lookup_editor(username=username)
+ except ApiException as ae:
+ abort(ae.status)
+ return redirect(f'/editor/{editor.editor_id}')
+
@app.route('/changelog', methods=['GET'])
def changelog_view():
try: