1
0
Fork 0

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
No known key found for this signature in database
GPG key ID: CD23D6039184286B
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)