fix kofi webhook

master
Aevann1 2022-09-14 10:01:25 +02:00
parent 1939396d69
commit 5587b415dc
2 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ def comment(v):
Comment.parent_comment_id == parent_comment_id, Comment.parent_comment_id == parent_comment_id,
Comment.parent_submission == parent_submission, Comment.parent_submission == parent_submission,
Comment.body_html == body_html Comment.body_html == body_html
).one_or_none() ).first()
if existing: return {"error": f"You already made that comment: /comment/{existing.id}"}, 409 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: if parent.author.any_block_exists(v) and v.admin_level < 2:

View File

@ -703,7 +703,7 @@ def message2(v, username):
body_html = sanitize(message) 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, existing = g.db.query(Comment.id).filter(Comment.author_id == v.id,
Comment.sentto == user.id, Comment.sentto == user.id,
Comment.body_html == body_html, Comment.body_html == body_html,
@ -1390,7 +1390,7 @@ def kofi():
if verification_token != KOFI_TOKEN: abort(400) if verification_token != KOFI_TOKEN: abort(400)
id = data['kofi_transaction_id'] 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'] type = data['type']
amount = int(float(data['amount'])) amount = int(float(data['amount']))
email = data['email'] email = data['email']