diff --git a/files/classes/blackjack.py b/files/classes/blackjack.py index 6859cf172..ffa8d6b58 100644 --- a/files/classes/blackjack.py +++ b/files/classes/blackjack.py @@ -62,6 +62,7 @@ class Blackjack: self.db = g.db def check_for_blackjack_command(self, in_text, from_user, from_comment): + in_text = in_text.lower() if self.command_word in in_text: for word in in_text.split(): if self.command_word in word: diff --git a/files/classes/comment.py b/files/classes/comment.py index 4207dbd14..1b471674a 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -417,7 +417,7 @@ class Comment(Base): if self.is_banned: return True - if path.startswith('/post') and (self.slots_result or self.blackjack_result) and len(self.body) <= 20 and self.level > 1: return True + if path.startswith('/post') and (self.slots_result or self.blackjack_result) and (not self.body or len(self.body) <= 20) and self.level > 1: return True if v and v.filter_words and self.body and any(x in self.body for x in v.filter_words): return True diff --git a/files/classes/slots.py b/files/classes/slots.py index 129c228bc..ee1e45b34 100644 --- a/files/classes/slots.py +++ b/files/classes/slots.py @@ -23,6 +23,7 @@ class Slots: self.db = g.db def check_for_slots_command(self, in_text, from_user, from_comment): + in_text = in_text.lower() if self.command_word in in_text: for word in in_text.split(): if self.command_word in word: diff --git a/files/helpers/const.py b/files/helpers/const.py index 5aaaac397..36f8d8d0f 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -559,5 +559,4 @@ REDDIT_NOTIFS = { } -no_pass_phrase = """

Sorry whiteboy, we're gonna need to see some ID before you start throwin that word around like it's nothing.\n\nTake a 10 minute time-out and come back when you've learned your lesson and/or paid reparations (by purchasing a BIPOC Approved™ Rdrama NWord Pass© from the shop) \n\nThis is an automated message; if you need help,+ - you can message us here.

""" \ No newline at end of file +no_pass_phrase = """

Sorry whiteboy, we're gonna need to see some ID before you start throwin that word around like it's nothing.\n\nTake a 10 minute time-out and come back when you've learned your lesson and/or paid reparations (by purchasing a BIPOC Approved™ Rdrama NWord Pass© from the shop) \n\nThis is an automated message; if you need help, you can message us here.

""" \ No newline at end of file diff --git a/files/helpers/filters.py b/files/helpers/filters.py index ef5cbf15e..bcfb2b086 100644 --- a/files/helpers/filters.py +++ b/files/helpers/filters.py @@ -15,15 +15,17 @@ def filter_comment_html(html_text): href = link.get("href") if not href: continue - - domain = urlparse(href).netloc + + url = urlparse(href) + domain = url.netloc + path = url.path + domain_list.add(domain+path) parts = domain.split(".") for i in range(len(parts)): new_domain = parts[i] for j in range(i + 1, len(parts)): new_domain += "." + parts[j] - domain_list.add(new_domain) bans = [x for x in g.db.query(BannedDomain).filter(BannedDomain.domain.in_(list(domain_list))).all()] diff --git a/files/helpers/images.py b/files/helpers/images.py index c29e78779..82f940375 100644 --- a/files/helpers/images.py +++ b/files/helpers/images.py @@ -12,7 +12,7 @@ def process_image(filename=None, resize=0): del exif[k] i.info["exif"] = exif.tobytes() - if resize: + if resize and i.width > resize: size = resize, resize frames = ImageSequence.Iterator(i) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 51d6c0f54..11d21e512 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -15,7 +15,6 @@ def get_logged_in_user(): v = client.user v.client = client - return v else: lo_user = session.get("lo_user") if not lo_user: return None @@ -31,7 +30,82 @@ def get_logged_in_user(): if not submitted_key: abort(401) elif not v.validate_formkey(submitted_key): abort(401) - return v + + if v.patron_utc and v.patron_utc < time.time(): + v.patron = 0 + v.patron_utc = 0 + send_repeatable_notification(v.id, "Your paypig status has expired!") + g.db.add(v) + g.db.commit() + + if v.unban_utc and v.unban_utc < time.time(): + v.is_banned = 0 + v.unban_utc = 0 + v.ban_evade = 0 + send_repeatable_notification(v.id, "You have been unbanned!") + g.db.add(v) + g.db.commit() + + if v.hidevotedon: posts = [x for x in posts if not hasattr(x, 'voted') or not x.voted] + + if v.agendaposter_expires_utc and v.agendaposter_expires_utc < time.time(): + v.agendaposter_expires_utc = 0 + v.agendaposter = None + send_repeatable_notification(v.id, "Your chud theme has expired!") + g.db.add(v) + badge = v.has_badge(26) + if badge: g.db.delete(badge) + g.db.commit() + + if v.flairchanged and v.flairchanged < time.time(): + v.flairchanged = None + send_repeatable_notification(v.id, "Your flair lock has expired. You can now change your flair!") + g.db.add(v) + badge = v.has_badge(96) + if badge: g.db.delete(badge) + g.db.commit() + + if v.marseyawarded and v.marseyawarded < time.time(): + v.marseyawarded = None + send_repeatable_notification(v.id, "Your marsey award has expired!") + g.db.add(v) + badge = v.has_badge(98) + if badge: g.db.delete(badge) + g.db.commit() + + if v.longpost and v.longpost < time.time(): + v.longpost = None + send_repeatable_notification(v.id, "Your pizzashill award has expired!") + g.db.add(v) + badge = v.has_badge(97) + if badge: g.db.delete(badge) + g.db.commit() + + if v.bird and v.bird < time.time(): + v.bird = None + send_repeatable_notification(v.id, "Your bird site award has expired!") + g.db.add(v) + badge = v.has_badge(95) + if badge: g.db.delete(badge) + g.db.commit() + + if v.progressivestack and v.progressivestack < time.time(): + v.progressivestack = None + send_repeatable_notification(v.id, "Your progressive stack has expired!") + g.db.add(v) + badge = v.has_badge(94) + if badge: g.db.delete(badge) + g.db.commit() + + if v.rehab and v.rehab < time.time(): + v.rehab = None + send_repeatable_notification(v.id, "Your rehab has finished!") + g.db.add(v) + badge = v.has_badge(109) + if badge: g.db.delete(badge) + g.db.commit() + + return v def check_ban_evade(v): if v and not v.patron and v.admin_level == 0 and v.ban_evade and not v.unban_utc: diff --git a/files/routes/comments.py b/files/routes/comments.py index e71a36e88..2c728753c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -214,7 +214,7 @@ def api_comment(v): process_image(filename, 200) requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/static/assets/images/badges/{badge.id}.webp"]}) except Exception as e: - return {"error": e}, 400 + return {"error": str(e)}, 400 elif v.admin_level > 2 and parent_post.id == 37838: try: marsey = loads(body.lower()) @@ -231,7 +231,7 @@ def api_comment(v): requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/static/assets/images/emojis/{name}.webp"]}) cache.delete_memoized(marsey_list) except Exception as e: - return {"error": e}, 400 + return {"error": str(e)}, 400 body += f"\n\n![]({image})" elif file.content_type.startswith('video/'): file.save("video.mp4") @@ -282,7 +282,7 @@ def api_comment(v): is_bot = bool(request.headers.get("Authorization")) - if not is_bot and not v.marseyawarded and AGENDAPOSTER_PHRASE not in body.lower() and len(body) > 10: + if parent_post.id not in (37696,37697,37749,37833,37838) and not is_bot and not v.marseyawarded and AGENDAPOSTER_PHRASE not in body.lower() and len(body) > 10: now = int(time.time()) cutoff = now - 60 * 60 * 24 @@ -385,201 +385,200 @@ def api_comment(v): n = Notification(comment_id=c_based.id, user_id=v.id) g.db.add(n) - if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower(): + if parent_post.id not in (37696,37697,37749,37833,37838): + if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower(): - c.is_banned = True - c.ban_reason = "AutoJanny" + c.is_banned = True + c.ban_reason = "AutoJanny" - g.db.add(c) + g.db.add(c) - body = AGENDAPOSTER_MSG.format(username=v.username, type='comment', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE) + body = AGENDAPOSTER_MSG.format(username=v.username, type='comment', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE) - body_jannied_html = sanitize(body) + body_jannied_html = sanitize(body) - c_jannied = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=parent_submission, - distinguish_level=6, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=body_jannied_html, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) + c_jannied = Comment(author_id=NOTIFICATIONS_ID, + parent_submission=parent_submission, + distinguish_level=6, + parent_comment_id=c.id, + level=level+1, + is_bot=True, + body_html=body_jannied_html, + top_comment_id=c.top_comment_id, + ghost=parent_post.ghost + ) - g.db.add(c_jannied) - g.db.flush() + g.db.add(c_jannied) + g.db.flush() - n = Notification(comment_id=c_jannied.id, user_id=v.id) - g.db.add(n) - - elif request.host == 'rdrama.net' and 'nigg' in c.body.lower() and not v.nwordpass: - - c.is_banned = True - c.ban_reason = "AutoJanny" - g.db.add(c) - - c_jannied = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=parent_submission, - distinguish_level=6, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=no_pass_phrase, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) - - g.db.add(c_jannied) - g.db.flush() - - v.ban(reason="White people nonsense.", days=0.007) - - text = "Your account has been suspended for 10 minutes for the following reason:\n\n> Unsanctioned NWord" - send_repeatable_notification(v.id, text) - - n = Notification(comment_id=c_jannied.id, user_id=v.id) - g.db.add(n) + n = Notification(comment_id=c_jannied.id, user_id=v.id) + g.db.add(n) - if request.host == "rdrama.net" and len(c.body) >= 1000 and "<" not in body and "" not in body_html: - - body = random.choice(LONGPOST_REPLIES) + elif request.host == 'rdrama.net' and 'nigg' in c.body.lower() and not v.nwordpass: - body_html2 = sanitize(body) + c.is_banned = True + c.ban_reason = "AutoJanny" + g.db.add(c) - c2 = Comment(author_id=LONGPOSTBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) + c_jannied = Comment(author_id=NOTIFICATIONS_ID, + parent_submission=parent_submission, + distinguish_level=6, + parent_comment_id=c.id, + level=level+1, + is_bot=True, + body_html=no_pass_phrase, + top_comment_id=c.top_comment_id, + ghost=parent_post.ghost + ) - g.db.add(c2) + g.db.add(c_jannied) + g.db.flush() - longpostbot = g.db.query(User).filter_by(id = LONGPOSTBOT_ID).one_or_none() - longpostbot.comment_count += 1 - longpostbot.coins += 1 - g.db.add(longpostbot) + v.ban(reason="White people nonsense.", days=0.007) + + text = "Your account has been suspended for 10 minutes for the following reason:\n\n> Unsanctioned NWord" + send_repeatable_notification(v.id, text) + + n = Notification(comment_id=c_jannied.id, user_id=v.id) + g.db.add(n) + + if request.host == "rdrama.net" and len(c.body) >= 1000 and "<" not in body and "" not in body_html: - g.db.flush() + body = random.choice(LONGPOST_REPLIES) - n = Notification(comment_id=c2.id, user_id=v.id) - g.db.add(n) + body_html2 = sanitize(body) + c2 = Comment(author_id=LONGPOSTBOT_ID, + parent_submission=parent_submission, + parent_comment_id=c.id, + level=level+1, + is_bot=True, + body_html=body_html2, + top_comment_id=c.top_comment_id, + ghost=parent_post.ghost + ) - if request.host == "rdrama.net" and random.random() < 0.001: - - body = "zoz" - body_html2 = sanitize(body) + g.db.add(c2) + longpostbot = g.db.query(User).filter_by(id = LONGPOSTBOT_ID).one_or_none() + longpostbot.comment_count += 1 + longpostbot.coins += 1 + g.db.add(longpostbot) + + g.db.flush() - - - c2 = Comment(author_id=ZOZBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) - - g.db.add(c2) - g.db.flush() - n = Notification(comment_id=c2.id, user_id=v.id) - g.db.add(n) - - - - - - body = "zle" - body_html2 = sanitize(body) - - - - c3 = Comment(author_id=ZOZBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c2.id, - level=level+2, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) - - g.db.add(c3) - g.db.flush() - - body = "zozzle" - body_html2 = sanitize(body) - - - c4 = Comment(author_id=ZOZBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c3.id, - level=level+3, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) - - g.db.add(c4) - - zozbot = g.db.query(User).filter_by(id = ZOZBOT_ID).one_or_none() - zozbot.comment_count += 3 - zozbot.coins += 3 - g.db.add(zozbot) - - - - - - if not v.shadowbanned and parent_post.id not in (37696,37697,37749,37833,37838): - notify_users = NOTIFY_USERS(body_html, v) - - for x in g.db.query(Subscription.user_id).filter_by(submission_id=c.parent_submission).all(): notify_users.add(x[0]) - - if parent.author.id not in [v.id, BASEDBOT_ID, AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, AUTOPOLLER_ID]: notify_users.add(parent.author.id) - - for x in notify_users: - n = Notification(comment_id=c.id, user_id=x) + n = Notification(comment_id=c2.id, user_id=v.id) g.db.add(n) - if parent.author.id != v.id and PUSHER_ID: - if len(c.body) > 500: notifbody = c.body[:500] + '...' - else: notifbody = c.body or 'no body' - beams_client.publish_to_interests( - interests=[f'{request.host}{parent.author.id}'], - publish_body={ - 'web': { - 'notification': { - 'title': f'New reply by @{c.author_name}', - 'body': notifbody, - 'deep_link': f'{SITE_FULL}/comment/{c.id}?context=8&read=true#context', - 'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp', + if request.host == "rdrama.net" and random.random() < 0.001: + + body = "zoz" + body_html2 = sanitize(body) + + + + + c2 = Comment(author_id=ZOZBOT_ID, + parent_submission=parent_submission, + parent_comment_id=c.id, + level=level+1, + is_bot=True, + body_html=body_html2, + top_comment_id=c.top_comment_id, + ghost=parent_post.ghost + ) + + g.db.add(c2) + g.db.flush() + n = Notification(comment_id=c2.id, user_id=v.id) + g.db.add(n) + + + + + + body = "zle" + body_html2 = sanitize(body) + + + + c3 = Comment(author_id=ZOZBOT_ID, + parent_submission=parent_submission, + parent_comment_id=c2.id, + level=level+2, + is_bot=True, + body_html=body_html2, + top_comment_id=c.top_comment_id, + ghost=parent_post.ghost + ) + + g.db.add(c3) + g.db.flush() + + body = "zozzle" + body_html2 = sanitize(body) + + + c4 = Comment(author_id=ZOZBOT_ID, + parent_submission=parent_submission, + parent_comment_id=c3.id, + level=level+3, + is_bot=True, + body_html=body_html2, + top_comment_id=c.top_comment_id, + ghost=parent_post.ghost + ) + + g.db.add(c4) + + zozbot = g.db.query(User).filter_by(id = ZOZBOT_ID).one_or_none() + zozbot.comment_count += 3 + zozbot.coins += 3 + g.db.add(zozbot) + + + if not v.shadowbanned: + notify_users = NOTIFY_USERS(body_html, v) + + for x in g.db.query(Subscription.user_id).filter_by(submission_id=c.parent_submission).all(): notify_users.add(x[0]) + + if parent.author.id not in [v.id, BASEDBOT_ID, AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, AUTOPOLLER_ID]: notify_users.add(parent.author.id) + + for x in notify_users: + n = Notification(comment_id=c.id, user_id=x) + g.db.add(n) + + if parent.author.id != v.id and PUSHER_ID: + if len(c.body) > 500: notifbody = c.body[:500] + '...' + else: notifbody = c.body or 'no body' + + beams_client.publish_to_interests( + interests=[f'{request.host}{parent.author.id}'], + publish_body={ + 'web': { + 'notification': { + 'title': f'New reply by @{c.author_name}', + 'body': notifbody, + 'deep_link': f'{SITE_FULL}/comment/{c.id}?context=8&read=true#context', + 'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp', + } + }, + 'fcm': { + 'notification': { + 'title': f'New reply by @{c.author_name}', + 'body': notifbody, + }, + 'data': { + 'url': f'/comment/{c.id}?context=8&read=true#context', + } } }, - 'fcm': { - 'notification': { - 'title': f'New reply by @{c.author_name}', - 'body': notifbody, - }, - 'data': { - 'url': f'/comment/{c.id}?context=8&read=true#context', - } - } - }, - ) + ) + vote = CommentVote(user_id=v.id, comment_id=c.id, diff --git a/files/routes/front.py b/files/routes/front.py index 81a129b36..23a3f40ca 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -186,81 +186,6 @@ def front_all(v): posts = get_posts(ids, v=v) - if v: - if v.patron_utc and v.patron_utc < time.time(): - v.patron = 0 - v.patron_utc = 0 - send_repeatable_notification(v.id, "Your paypig status has expired!") - g.db.add(v) - g.db.commit() - - if v.unban_utc and v.unban_utc < time.time(): - v.is_banned = 0 - v.unban_utc = 0 - v.ban_evade = 0 - send_repeatable_notification(v.id, "You have been unbanned!") - g.db.add(v) - g.db.commit() - - if v.hidevotedon: posts = [x for x in posts if not hasattr(x, 'voted') or not x.voted] - - if v.agendaposter_expires_utc and v.agendaposter_expires_utc < time.time(): - v.agendaposter_expires_utc = 0 - v.agendaposter = None - send_repeatable_notification(v.id, "Your chud theme has expired!") - g.db.add(v) - badge = v.has_badge(26) - if badge: g.db.delete(badge) - g.db.commit() - - if v.flairchanged and v.flairchanged < time.time(): - v.flairchanged = None - send_repeatable_notification(v.id, "Your flair lock has expired. You can now change your flair!") - g.db.add(v) - badge = v.has_badge(96) - if badge: g.db.delete(badge) - g.db.commit() - - if v.marseyawarded and v.marseyawarded < time.time(): - v.marseyawarded = None - send_repeatable_notification(v.id, "Your marsey award has expired!") - g.db.add(v) - badge = v.has_badge(98) - if badge: g.db.delete(badge) - g.db.commit() - - if v.longpost and v.longpost < time.time(): - v.longpost = None - send_repeatable_notification(v.id, "Your pizzashill award has expired!") - g.db.add(v) - badge = v.has_badge(97) - if badge: g.db.delete(badge) - g.db.commit() - - if v.bird and v.bird < time.time(): - v.bird = None - send_repeatable_notification(v.id, "Your bird site award has expired!") - g.db.add(v) - badge = v.has_badge(95) - if badge: g.db.delete(badge) - g.db.commit() - - if v.progressivestack and v.progressivestack < time.time(): - v.progressivestack = None - send_repeatable_notification(v.id, "Your progressive stack has expired!") - g.db.add(v) - badge = v.has_badge(94) - if badge: g.db.delete(badge) - g.db.commit() - - if v.rehab and v.rehab < time.time(): - v.rehab = None - send_repeatable_notification(v.id, "Your rehab has finished!") - g.db.add(v) - badge = v.has_badge(109) - if badge: g.db.delete(badge) - g.db.commit() - if request.headers.get("Authorization"): return {"data": [x.json for x in posts], "next_exists": next_exists} return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page, ccmode=ccmode) diff --git a/files/routes/login.py b/files/routes/login.py index 48d8e4504..97d981e67 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -85,11 +85,7 @@ def login_post(): username = request.values.get("username") if not username: abort(400) - if "@" in username: - account = g.db.query(User).filter( - User.email.ilike(username)).one_or_none() - else: - account = get_user(username, graceful=True) + account = get_user(username, graceful=True) if not account: time.sleep(random.uniform(0, 2)) diff --git a/files/routes/posts.py b/files/routes/posts.py index efc962bcb..dff26f7ba 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -822,6 +822,7 @@ def submit_post(v): if repost: return redirect(repost.permalink) domain_obj = get_domain(domain) + if not domain_obj: domain_obj = get_domain(domain+parsed_url.path) if domain_obj: reason = f"Remove the {domain_obj.domain} link from your post and try again. {domain_obj.reason}" if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":reason}, 400 diff --git a/files/routes/static.py b/files/routes/static.py index 646bcbd87..3696b30c8 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -98,7 +98,11 @@ def stats(): def chart(v): days = int(request.values.get("days", 0)) file = cached_chart(days) - return send_file(file) + try: f = send_file(file) + except: + print('/chart', flush=True) + abort(404) + return f @cache.memoize(timeout=86400) @@ -254,7 +258,11 @@ def log_item(id, v): @app.get("/static/assets/favicon.ico") def favicon(): - return send_file(f"./assets/images/{SITE_NAME}/icon.webp") + try: f = send_file(f"./assets/images/{SITE_NAME}/icon.webp") + except: + print('/static/assets/favicon.ico', flush=True) + abort(404) + return f @app.get("/api") @auth_required @@ -340,8 +348,11 @@ def images(path): @app.get("/robots.txt") def robots_txt(): - return send_file("assets/robots.txt") - + try: f = send_file("assets/robots.txt") + except: + print('/robots.txt', flush=True) + abort(404) + return f @app.get("/badges") @auth_required diff --git a/files/routes/users.py b/files/routes/users.py index fb05d81f3..35c2e2b61 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -609,7 +609,12 @@ def mfa_qr(secret, v): img.save(mem, format="PNG") mem.seek(0, 0) - return send_file(mem, mimetype="image/png", as_attachment=False) + + try: f = send_file(mem, mimetype="image/png", as_attachment=False) + except: + print('/2faqr/', flush=True) + abort(404) + return f @app.get("/is_available/") diff --git a/files/routes/votes.py b/files/routes/votes.py index 522c21adc..76fde6776 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -24,6 +24,8 @@ def admin_vote_info_get(v): if thing.ghost: abort(403) + if not thing.author: + print(thing.id, flush=True) if isinstance(thing, Submission): if thing.author.shadowbanned and not (v and v.admin_level): thing_id = g.db.query(Submission.id).filter_by(upvotes=thing.upvotes, downvotes=thing.downvotes).order_by(Submission.id).first()[0] @@ -60,7 +62,7 @@ def admin_vote_info_get(v): v=v, thing=thing, ups=ups, - downs=downs,) + downs=downs) diff --git a/files/templates/admin/badge_grant.html b/files/templates/admin/badge_grant.html index 3381a853b..56aadac2b 100644 --- a/files/templates/admin/badge_grant.html +++ b/files/templates/admin/badge_grant.html @@ -56,7 +56,7 @@
- +
diff --git a/files/templates/admin/badge_remove.html b/files/templates/admin/badge_remove.html index a91f5210c..cb5d62986 100644 --- a/files/templates/admin/badge_remove.html +++ b/files/templates/admin/badge_remove.html @@ -56,7 +56,7 @@
- +
diff --git a/files/templates/badges.html b/files/templates/badges.html index 643c3d6b5..85c4398ea 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -13,6 +13,7 @@
+ @@ -20,6 +21,7 @@ {% for badge in badges %} + diff --git a/files/templates/header.html b/files/templates/header.html index 482a7ea35..d1d1be66c 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -174,7 +174,7 @@ - Android app + Android appSource code diff --git a/files/templates/home.html b/files/templates/home.html index 813f61964..c275ca008 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -44,7 +44,7 @@ {% if request.path == '/' and v.paid_dues %} {% if ccmode=="true"%}CC Mode: Activated{% endif %} - {% if ccmode=="false" or not ccmode %}CC Mode{% endif %} + {% if ccmode=="false" or not ccmode %}CC Mode{% endif %}
{% endif %} diff --git a/files/templates/shop.html b/files/templates/shop.html index a4aaa36fb..7bdff14ea 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -61,7 +61,7 @@ {% if a['baseprice'] != a['price'] %} - + {% endif %} {% if a['baseprice'] == a['price'] %} diff --git a/files/templates/sidebar_Drama.html b/files/templates/sidebar_Drama.html index 401de2ef9..9b1f2fcaa 100644 --- a/files/templates/sidebar_Drama.html +++ b/files/templates/sidebar_Drama.html @@ -1,7 +1,7 @@
# Name Image Description
{{loop.index}} {{badge.name}} {{badge.name}} {{badge.description}} {{a['title']}}{{a['baseprice']}} {{a['price']}}{{a['baseprice']}} {{a['price']}}{{a['price']}}