diff --git a/files/routes/admin.py b/files/routes/admin.py index b9321b343f..3437a74835 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -213,6 +213,7 @@ def monthly(v): for u in g.db.query(User).filter(User.patron > 0, User.patron_utc == 0).all(): if u.email and u.email.lower() in emails: + continue if u.patron == 1: procoins = 2500 elif u.patron == 2: procoins = 5000 elif u.patron == 3: procoins = 10000 @@ -222,18 +223,18 @@ def monthly(v): g.db.add(u) send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") elif u.patron == 5: + continue procoins = 50000 u.procoins += procoins g.db.add(u) send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") elif u.patron == 1 and u.admin_level > 0: + continue procoins = 2500 u.procoins += procoins g.db.add(u) send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") - else: - print(u.username) - continue + else: print(u.username) if request.host == 'pcmemes.net': u = g.db.query(User).filter_by(id=KIPPY_ID).one() diff --git a/files/routes/comments.py b/files/routes/comments.py index 7355a1d132..ae45195e3c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -219,8 +219,11 @@ def api_comment(v): try: marsey = loads(body.lower()) name = marsey["name"] + if "author" in marsey: author_id = get_user(marsey["author"]) + elif "author_id" in marsey: author_id = marsey["author_id"] + else: abort(400) if not g.db.query(Marsey.name).filter_by(name=name).first(): - marsey = Marsey(name=marsey["name"], author_id=marsey["author_id"], tags=marsey["tags"], count=0) + marsey = Marsey(name=marsey["name"], author_id=author_id, tags=marsey["tags"], count=0) g.db.add(marsey) filename = f'files/assets/images/emojis/{name}.webp' copyfile(oldname, filename)