forked from rDrama/rDrama
1
0
Fork 0

remove unnecessary fstrings

(or actually use the feature)
master
justcool393 2022-11-17 10:00:49 -06:00
parent fa9290a794
commit caf3a81748
4 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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}")

View File

@ -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

View File

@ -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())))