diff --git a/openlibrary/plugins/admin/code.py b/openlibrary/plugins/admin/code.py index de4d83bd4a3..d6192bf5b0d 100644 --- a/openlibrary/plugins/admin/code.py +++ b/openlibrary/plugins/admin/code.py @@ -25,7 +25,7 @@ import openlibrary from openlibrary import accounts - +from openlibrary.accounts.model import OpenLibraryAccount from openlibrary.core import admin as admin_stats, helpers as h, imports, cache from openlibrary.core.waitinglist import Stats as WLStats from openlibrary.core.sponsorships import summary, sync_completed_sponsored_books @@ -174,13 +174,16 @@ def GET(self): class people: def GET(self): - i = web.input(email=None) + i = web.input(email=None, ia_id=None) + account = None if i.email: account = accounts.find(email=i.email) - if account: - raise web.seeother("/admin/people/" + account.username) - return render_template("admin/people/index", email=i.email) + if i.ia_id: + account = OpenLibraryAccount.get_by_link(i.ia_id) + if account: + raise web.seeother(f"/admin/people/{account.username}") + return render_template("admin/people/index", email=i.email, ia_id=i.ia_id) class add_work_to_staff_picks: diff --git a/openlibrary/templates/admin/people/index.html b/openlibrary/templates/admin/people/index.html index 1fefa4e15fe..1086798b1d1 100644 --- a/openlibrary/templates/admin/people/index.html +++ b/openlibrary/templates/admin/people/index.html @@ -1,4 +1,4 @@ -$def with (email=None) +$def with (email=None, ia_id=None) $var title: [Admin Center] People @@ -16,7 +16,8 @@