beautiful code quality, pylint will be pleased
This commit is contained in:
parent
9a3ec4362b
commit
1211fda7ff
|
@ -33,7 +33,7 @@
|
||||||
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
||||||
<script>
|
<script>
|
||||||
function closeWindow() {
|
function closeWindow() {
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -113,22 +113,13 @@ def ostatus_follow_request(request):
|
||||||
if request.user.id:
|
if request.user.id:
|
||||||
|
|
||||||
# you have blocked them so you probably don't want to follow
|
# you have blocked them so you probably don't want to follow
|
||||||
if (
|
if hasattr(request.user, "blocks") and user in request.user.blocks.all():
|
||||||
hasattr(request.user, "blocks")
|
|
||||||
and user in request.user.blocks.all()
|
|
||||||
):
|
|
||||||
error = "is_blocked"
|
error = "is_blocked"
|
||||||
# they have blocked you
|
# they have blocked you
|
||||||
if (
|
if hasattr(user, "blocks") and request.user in user.blocks.all():
|
||||||
hasattr(user, "blocks")
|
|
||||||
and request.user in user.blocks.all()
|
|
||||||
):
|
|
||||||
error = "has_blocked"
|
error = "has_blocked"
|
||||||
# you're already following them
|
# you're already following them
|
||||||
if (
|
if hasattr(user, "followers") and request.user in user.followers.all():
|
||||||
hasattr(user, "followers")
|
|
||||||
and request.user in user.followers.all()
|
|
||||||
):
|
|
||||||
error = "already_following"
|
error = "already_following"
|
||||||
# you're not following yet but you already asked
|
# you're not following yet but you already asked
|
||||||
if (
|
if (
|
||||||
|
@ -165,8 +156,6 @@ def remote_follow(request):
|
||||||
if template is None:
|
if template is None:
|
||||||
data = {"account": remote_user, "user": None, "error": "remote_subscribe"}
|
data = {"account": remote_user, "user": None, "error": "remote_subscribe"}
|
||||||
return TemplateResponse(request, "ostatus/subscribe.html", data)
|
return TemplateResponse(request, "ostatus/subscribe.html", data)
|
||||||
user = get_object_or_404(
|
user = get_object_or_404(models.User, id=request.POST.get("user"))
|
||||||
models.User, id=request.POST.get("user")
|
|
||||||
)
|
|
||||||
url = template.replace("{uri}", urllib.parse.quote(user.remote_id))
|
url = template.replace("{uri}", urllib.parse.quote(user.remote_id))
|
||||||
return redirect(url)
|
return redirect(url)
|
||||||
|
|
Loading…
Reference in New Issue