From caf3a8174862f73998bcb0bcc7d0aaf52986cbff Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 17 Nov 2022 10:00:49 -0600 Subject: [PATCH] remove unnecessary fstrings (or actually use the feature) --- files/routes/login.py | 2 +- files/routes/posts.py | 2 +- files/routes/static.py | 4 ++-- files/routes/wrappers.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/routes/login.py b/files/routes/login.py index 77c8afc05..4fefcbd16 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -111,7 +111,7 @@ def log_failed_admin_login_attempt(account:User, type:str): ip = get_CF() print(f"Admin user from {ip} failed to login to account @{account.user_name} (invalid {type})!") try: - with open(f"/admin_failed_logins", "a+", encoding="utf-8") as f: + with open("/admin_failed_logins", "a+", encoding="utf-8") as f: t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time()))) f.write(f"{t}, {ip}, {account.username}, {type}\n") except: diff --git a/files/routes/posts.py b/files/routes/posts.py index 6b763266b..70befd2a2 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -634,7 +634,7 @@ def submit_post(v, sub=None): # we also allow 'code contributor' badgeholders to post to the changelog hole allowed = g.db.query(Badge.user_id).filter_by(badge_id=3).all() allowed = [x[0] for x in allowed] - if v.id not in allowed: return error(f"You don't have sufficient permissions to post in /h/changelog") + if v.id not in allowed: return error("You don't have sufficient permissions to post in /h/changelog") if sub in ('furry','vampire','racist','femboy') and not v.client and not v.house.lower().startswith(sub): return error(f"You need to be a member of House {sub.capitalize()} to post in /h/{sub}") diff --git a/files/routes/static.py b/files/routes/static.py index 60e0ae998..4c58816b8 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -217,7 +217,7 @@ def submit_contact(v): if v.is_muted: abort(403) - body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n' + body + body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n{body}' body += process_files(request.files, v) body = body.strip() body_html = sanitize(body) @@ -406,7 +406,7 @@ def transfers(v): if not os.path.exists(f'files/templates/donate_{SITE_NAME}.html'): - copyfile(f'files/templates/donate_rDrama.html', f'files/templates/donate_{SITE_NAME}.html') + copyfile('files/templates/donate_rDrama.html', f'files/templates/donate_{SITE_NAME}.html') @app.get('/donate') @auth_desired_with_logingate diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index a5c135668..984bae7f3 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -80,7 +80,7 @@ def get_logged_in_user(): if AEVANN_ID and request.headers.get("Cf-Ipcountry") == 'EG': if v and not v.username.startswith('Aev') and v.truescore > 0: - with open(f"/eg", "r+", encoding="utf-8") as f: + with open("/eg", "r+", encoding="utf-8") as f: ip = request.headers.get('CF-Connecting-IP') if f'@{v.username}, ' not in f.read(): t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))