fixes
This commit is contained in:
parent
ed6ab7cea0
commit
f7d22cf36c
2
main
2
main
|
@ -382,7 +382,7 @@ def signup():
|
|||
if usersession:
|
||||
return redirect(url_for("main"))
|
||||
if request.method == "POST":
|
||||
if not check_username_taken(request.form["username"]) == "error":
|
||||
if not check_username_taken(str(request.form["username"]).lower()) == "error":
|
||||
flash("Username already taken :3")
|
||||
return redirect(url_for("signup"))
|
||||
|
||||
|
|
|
@ -22,15 +22,13 @@ for (let i = 0; i < posts.length; i++) {
|
|||
title = String(commentBox.value)
|
||||
id = String(commentId.innerHTML)
|
||||
|
||||
commentDiv.classList.add("hidden")
|
||||
commentBurgerDiv.classList.remove("hidden")
|
||||
|
||||
function addPost() {
|
||||
console.log("fart")
|
||||
|
||||
let para = document.createElement("p");
|
||||
const node = document.createTextNode(usernameElement.innerHTML + ": " + title);
|
||||
para.appendChild(node)
|
||||
commentBurgerDiv.append(para)
|
||||
}
|
||||
let para = document.createElement("p");
|
||||
const node = document.createTextNode(usernameElement.innerHTML + ": " + title);
|
||||
para.appendChild(node)
|
||||
commentBurgerDiv.append(para)
|
||||
|
||||
fetch("/api/comment", {
|
||||
method: "POST",
|
||||
|
@ -42,8 +40,5 @@ for (let i = 0; i < posts.length; i++) {
|
|||
"Content-Type": "application/json"
|
||||
}
|
||||
})
|
||||
.then((response) => addPost())
|
||||
|
||||
commentDiv.classList.add("hidden")
|
||||
});
|
||||
}
|
|
@ -51,7 +51,7 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="commentBurgerDiv" class="hidden"></div>
|
||||
<div id="commentBurgerDiv" class="hidden commentsdiv"></div>
|
||||
{% endif %}
|
||||
<p id="commentId" class="hidden">{{ post.id }}</p>
|
||||
<button id="commentButton" class="comment">comment</button>
|
||||
|
|
Reference in New Issue