changes
This commit is contained in:
parent
8330a8a5be
commit
7470ea2c98
9
main
9
main
|
@ -337,8 +337,7 @@ def apipost():
|
|||
|
||||
if not user["banned"] == "0":
|
||||
return {
|
||||
"error": "banned",
|
||||
"reason": user["banned"]
|
||||
"error": "banned"
|
||||
}, 403
|
||||
|
||||
conn = get_db_connection()
|
||||
|
@ -391,8 +390,7 @@ def post():
|
|||
user = get_user(userCookie["id"])
|
||||
|
||||
if not user["banned"] == "0":
|
||||
flash("Your account has been banned. Reason: " +
|
||||
user["banned"])
|
||||
flash("Your account has been banned. You may no longer perform this action.")
|
||||
return redirect(url_for("post"))
|
||||
|
||||
filename = secure_filename(file.filename)
|
||||
|
@ -438,8 +436,7 @@ def comment():
|
|||
|
||||
if not user["banned"] == "0":
|
||||
return {
|
||||
"error": "banned",
|
||||
"reason": user["banned"]
|
||||
"error": "banned"
|
||||
}, 403
|
||||
|
||||
conn = get_db_connection()
|
||||
|
|
|
@ -163,6 +163,13 @@ body {
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
.warning {
|
||||
width: 100%;
|
||||
background-color: #f1b739;
|
||||
color: black;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
|
@ -29,6 +29,12 @@
|
|||
</script>
|
||||
|
||||
<div class="postDiv">
|
||||
{% if userdata %}
|
||||
{% if userdata.banned == "0" %}
|
||||
{% else %}
|
||||
<p class="warning">Your account has been banned. Reason: "{{ userdata.banned }}". <a href="/settings/logout">Log out</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for post in posts %}
|
||||
<div class="post" id="post">
|
||||
<p><a href='/@{{ getUser(post["creator"])["username"] }}' class="username usernamelink">{{ getUser(post["creator"])["username"] }}</a></p>
|
||||
|
|
Reference in New Issue