webmention.py noop: move webmention_interactive() up under webmention_external()

delete
Ryan Barrett 2023-04-16 17:37:02 -07:00
rodzic 842f8ac964
commit 82912248ff
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 16 dodań i 16 usunięć

Wyświetl plik

@ -149,6 +149,22 @@ def webmention_external():
return msg, 202
@app.post('/webmention-interactive')
def webmention_interactive():
"""Handler that runs interactive webmention-based requests from the web UI.
...eg the update profile button on user pages.
"""
try:
webmention_external()
flash(f'Updating fediverse profile from <a href="{g.user.homepage}">{g.user.key.id()}</a>...')
except HTTPException as e:
flash(util.linkify(str(e.description), pretty=True))
path = f'/user/{g.user.key.id()}' if g.user else '/'
return redirect(path, code=302)
@app.post('/_ah/queue/webmention')
def webmention_task():
"""Handles webmention task, converts to ActivityPub and delivers."""
@ -404,19 +420,3 @@ def _activitypub_targets(obj):
logger.info(f"Delivering to targets' inboxes: {inboxes_to_targets.keys()}")
return inboxes_to_targets
@app.post('/webmention-interactive')
def webmention_interactive():
"""Handler that runs interactive webmention-based requests from the web UI.
...eg the update profile button on user pages.
"""
try:
webmention_external()
flash(f'Updating fediverse profile from <a href="{g.user.homepage}">{g.user.key.id()}</a>...')
except HTTPException as e:
flash(util.linkify(str(e.description), pretty=True))
path = f'/user/{g.user.key.id()}' if g.user else '/'
return redirect(path, code=302)