|
|
|
@ -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:
|
|
|
|
|