reenable posting and use helper more

This commit is contained in:
lza_menace 2020-12-03 23:30:49 -08:00
parent b8d227b3c8
commit 42af653ff3

View file

@ -56,10 +56,8 @@ def read(id):
@login_required
@profile_required
def create():
flash("Posting is paused for a little while because people want to be rude and spammy.")
return redirect("/")
if request.method == "POST":
submitter = session["auth"]["preferred_username"]
submitter = get_session_user()
if submitter in config.BANNED_USERS:
reason = config.BANNED_USERS[submitter]
flash(f"You can't post for now: {reason}")
@ -120,7 +118,7 @@ def approve(id):
@login_required
def delete(id):
filtered = Post.filter(id=id)
user = session["auth"]["preferred_username"]
user = get_session_user()
if filtered:
post = filtered.first()
if user == post.submitter: