From a395c189550d4555c0b881727c4f6eb2faab626f Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 22 Feb 2023 19:27:33 +0200 Subject: [PATCH] remove unnecessary tabs --- files/assets/js/bottom.js | 2 +- files/assets/js/chat.js | 2 +- files/classes/user.py | 4 ++-- files/helpers/media.py | 10 +++++----- files/routes/admin.py | 2 +- files/routes/comments.py | 4 ++-- files/routes/users.py | 2 +- files/routes/votes.py | 2 +- files/routes/wrappers.py | 2 +- files/templates/chat.html | 2 +- files/templates/sidebar_rDrama.html | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/files/assets/js/bottom.js b/files/assets/js/bottom.js index 4fe3be0fd..ec2a41e85 100644 --- a/files/assets/js/bottom.js +++ b/files/assets/js/bottom.js @@ -102,7 +102,7 @@ function register_new_elements(e) { for (const element of showmores) { element.onclick = () => {showmore(element)}; } - + const onclick = e.querySelectorAll('[data-onclick]'); for (const element of onclick) { element.onclick = () => {execute(element, 'onclick')}; diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index 93b00b169..5a4925294 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -287,7 +287,7 @@ document.addEventListener('click', function (e) { btn.previousElementSibling.classList.remove('d-none'); } } - + if (e.target.id == "cancel") { document.getElementById("quotes").classList.add("d-none"); document.getElementById('quotes_id').value = null; diff --git a/files/classes/user.py b/files/classes/user.py index ca3197863..e593ff9f9 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -391,12 +391,12 @@ class User(Base): date = time.strftime("%d %b", time.gmtime(self.created_utc)) now = time.strftime("%d %b", time.gmtime()) if date == now: return True - + if time.time() - self.created_utc > 365 * 86400 and not self.has_badge(134): new_badge = Badge(badge_id=134, user_id=self.id) g.db.add(new_badge) g.db.flush() - + return False @property diff --git a/files/helpers/media.py b/files/helpers/media.py index d422aecc1..810da839d 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -29,7 +29,7 @@ def process_files(files, v): body = '' if g.is_tor or not files.get("file"): return body files = files.getlist('file')[:4] - + if files: media_ratelimit(v) @@ -63,7 +63,7 @@ def process_audio(file, v): media = g.db.query(Media).filter_by(filename=name, kind='audio').one_or_none() if media: g.db.delete(media) - + media = Media( kind='audio', filename=name, @@ -259,12 +259,12 @@ def process_dm_images(v, user): ).json() except requests.Timeout: abort(400, "Image upload timed out, please try again!") - + try: url = req['files'][0]['url'] except: abort(400, req['description']) - + body += f'\n\n{url}\n\n' - + if body: with open(f"{LOG_DIRECTORY}/dm_images.log", "a+", encoding="utf-8") as f: if user: diff --git a/files/routes/admin.py b/files/routes/admin.py index 0fe41e5c7..4d6767ee6 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -850,7 +850,7 @@ def admin_title_change(user_id, v): message = f"@{v.username} (a site admin) has locked your flair to `{user.customtitleplain}`." else: message = f"@{v.username} (a site admin) has changed your flair to `{user.customtitleplain}`. You can change it back in the settings." - + send_repeatable_notification(user.id, message) return {"message": f"@{user.username}'s flair has been changed!"} diff --git a/files/routes/comments.py b/files/routes/comments.py index 16d0b98ee..284435377 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -47,7 +47,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): post = NOTIFICATION_THREAD post = get_post(post, v=v) - + if post.over_18 and not (v and v.over_18) and not session.get('over_18', 0) >= int(time.time()): if v and v.client: abort(403, "This content is not suitable for some users and situations!") else: return render_template("errors/nsfw.html", v=v), 403 @@ -152,7 +152,7 @@ def comment(v:User): if request.files.get("file") and not g.is_tor: files = request.files.getlist('file')[:4] - + if files: media_ratelimit(v) diff --git a/files/routes/users.py b/files/routes/users.py index 456689247..d51b0b0f1 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1364,7 +1364,7 @@ def gumroad(): type = data['recurrence'] amount = int(data['price']) / 100 email = data['email'] - + transaction = Transaction( id=id, created_utc=created_utc, diff --git a/files/routes/votes.py b/files/routes/votes.py index 1d6c91ae5..bc4ef1f0c 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -93,7 +93,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): if SITE_NAME == 'WPD': coin_mult *= 2 - + if IS_FISTMAS(): coin_mult *= 2 diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 56a92840c..bde1204c9 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -17,7 +17,7 @@ def get_ID(): x = session.get("lo_user") else: x = "logged_out" - + return f'{SITE}-{x}' diff --git a/files/templates/chat.html b/files/templates/chat.html index 6a9a61779..d246dfcb1 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -111,7 +111,7 @@ - +