From b4b4ab1e9a41747642e67cfed698b66e4b49a625 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 10 Jun 2022 22:09:59 +0200 Subject: [PATCH] when granting monthly awards, add 5 days to the date so when I grant awards on 29/5 for example, it says in the notification "for the month of July" instead of "for the month of May" extremely minor but I have autism --- files/routes/admin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 6903fe2aa..bad1f3540 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -15,15 +15,13 @@ from flask import * from files.__main__ import app, cache, limiter from .front import frontlist from files.helpers.discord import add_role -from datetime import datetime +import datetime import requests from urllib.parse import quote, urlencode GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip() GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip() -month = datetime.now().strftime('%B') - @app.get('/admin/loggedin') @admin_level_required(2) def loggedin_list(v): @@ -376,6 +374,9 @@ def club_ban(v, username): def monthly(v): if SITE_NAME == 'rDrama' and v.id != AEVANN_ID: abort (403) + month = datetime.datetime.now() + datetime.timedelta(days=5) + month = month.strftime('%B') + data = {'access_token': GUMROAD_TOKEN} emails = [x['email'] for x in requests.get(f'https://api.gumroad.com/v2/products/{GUMROAD_ID}/subscribers', data=data, timeout=5).json()["subscribers"]]