handle username errors in remote follow form

This commit is contained in:
Hugh Rundle
2021-11-29 07:11:57 +11:00
parent 6abf5d6910
commit feaf0d5e52
2 changed files with 8 additions and 0 deletions

View File

@ -148,5 +148,8 @@ def remote_follow(request):
"""direct user to follow from remote account using ostatus subscribe protocol"""
remote_user = request.POST.get("remote_user")
template = subscribe_remote_webfinger(remote_user)
if template is None:
data = {"account": remote_user, "user": None, "error": "remote_subscribe"}
return TemplateResponse(request, "ostatus/subscribe.html", data)
url = template.replace("{uri}", request.POST.get("user"))
return redirect(url)