diff --git a/files/routes/comments.py b/files/routes/comments.py index f154d3a16..c9ae52659 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -261,7 +261,7 @@ def comment(v): Comment.parent_comment_id == parent_comment_id, Comment.parent_submission == parent_submission, Comment.body_html == body_html - ).one_or_none() + ).first() if existing: return {"error": f"You already made that comment: /comment/{existing.id}"}, 409 if parent.author.any_block_exists(v) and v.admin_level < 2: diff --git a/files/routes/users.py b/files/routes/users.py index 265aa0e07..071db4ce8 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -703,7 +703,7 @@ def message2(v, username): body_html = sanitize(message) - if not (SITE == 'rdrama.net' and message == '!withdrawall' and user.id == 12732): + if not (SITE == 'rdrama.net' and user.id == 12732): existing = g.db.query(Comment.id).filter(Comment.author_id == v.id, Comment.sentto == user.id, Comment.body_html == body_html, @@ -1390,7 +1390,7 @@ def kofi(): if verification_token != KOFI_TOKEN: abort(400) id = data['kofi_transaction_id'] - created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%S"))) + created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%SZ"))) type = data['type'] amount = int(float(data['amount'])) email = data['email']