diff --git a/env b/env index a5b338a8a8..c65eca5677 100644 --- a/env +++ b/env @@ -23,7 +23,7 @@ GUMROAD_LINK=https://marsey1.gumroad.com/l/rdrama GUMROAD_ID=rdrama CARD_VIEW=0 DISABLE_DOWNVOTES=0 -DUES=10 +DUES=0 DEFAULT_THEME=midnight DEFAULT_COLOR=ff66ac MAIL_USERNAME=blahblahblah@gmail.com diff --git a/files/__main__.py b/files/__main__.py index 0a8ae30880..d9fe1f4e76 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -45,15 +45,12 @@ app.config['MAIL_SERVER'] = 'smtp.gmail.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True -# if environ.get("MAIL_USERNAME2") and random.random() < 0.5: -# app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME2", "").strip() -# app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD2", "").strip() -# else: -# app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip() -# app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip() - -app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip() -app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip() +if environ.get("MAIL_USERNAME2") and random.random() < 0.5: + app.config['MAIL_USERNAME2'] = environ.get("MAIL_USERNAME2", "").strip() + app.config['MAIL_PASSWORD2'] = environ.get("MAIL_PASSWORD2", "").strip() +else: + app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip() + app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip() app.config['SETTINGS'] = {} diff --git a/files/classes/user.py b/files/classes/user.py index 8473911e45..380849b99b 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -305,7 +305,7 @@ class User(Base): def paid_dues(self): if not FEATURES['COUNTRY_CLUB']: return True - return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins > dues)) + return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins >= dues)) @lazy def any_block_exists(self, other): diff --git a/files/helpers/const.py b/files/helpers/const.py index bf02b2f592..bd2dc8b4c0 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1033,7 +1033,7 @@ GUMROAD_ID = environ.get("GUMROAD_ID", "rdrama").strip() DEFAULT_THEME = environ.get("DEFAULT_THEME", "midnight").strip() DEFAULT_TIME_FILTER = environ.get("DEFAULT_TIME_FILTER", "all").strip() CARD_VIEW = bool(int(environ.get("CARD_VIEW", 1))) -DISABLE_DOWNVOTES = bool(int(environ.get("CARD_VIEW", 0))) +DISABLE_DOWNVOTES = bool(int(environ.get("DISABLE_DOWNVOTES", 0))) DISCORD_SERVER_ID = environ.get("DISCORD_SERVER_ID",'').strip() DISCORD_CLIENT_ID = environ.get("DISCORD_CLIENT_ID",'').strip() DISCORD_CLIENT_SECRET = environ.get("DISCORD_CLIENT_SECRET",'').strip() diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index d1b5e0aabf..f599959afd 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -53,9 +53,9 @@ def inject_constants(): "AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR, - "COLORS":COLORS, "time":time, "PERMS": PERMS, "FEATURES": FEATURES, - "HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED, - "LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK, - "DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, - "has_sidebar": has_sidebar, "has_logo": has_logo, "has_app": has_app, - "FP": FP, "NOTIF_MODACTION_JL_MIN": NOTIF_MODACTION_JL_MIN, "cache": cache, "ONLINE_STR": ONLINE_STR, "patron": patron, "approved_embed_hosts": approved_embed_hosts} + "COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES, + "HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED, + "LOTTERY_ENABLED":LOTTERY_ENABLED, "GUMROAD_LINK":GUMROAD_LINK, + "DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION, + "has_sidebar":has_sidebar, "has_logo":has_logo, "has_app":has_app, + "FP":FP, "NOTIF_MODACTION_JL_MIN":NOTIF_MODACTION_JL_MIN, "cache":cache, "ONLINE_STR":ONLINE_STR, "patron":patron, "approved_embed_hosts":approved_embed_hosts, "dues":dues} diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 970d7c77d7..beca913160 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -82,7 +82,7 @@ def get_logged_in_user(): 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()))) - f.write(f'{f.read()}@{v.username}, {ip}, {t}\n') + f.write(f'{f.read()}@{v.username}, {v.truecoins}, {ip}, {t}\n') elif not v and request.path not in ('/login','/signup'): abort(401) diff --git a/files/routes/errors.py b/files/routes/errors.py index 89f7da9fe9..54f9f59239 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -18,7 +18,8 @@ def error_401(e): else: path = request.path qs = urlencode(dict(request.values)) - argval = quote(f"{path}?{qs}", safe='') + argval = quote(f"{path}?{qs}", safe='').replace('/logged_out','') + if not argval: argval = '/' if session.get("history"): return redirect(f"/login?redirect={argval}") else: return redirect(f"/signup?redirect={argval}") diff --git a/files/routes/settings.py b/files/routes/settings.py index 20e3fa5d7a..11e9c0ad44 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -354,7 +354,7 @@ def gumroad(v): procoins = procoins_li[tier] - procoins_li[v.patron] if procoins < 0: return {"error": f"{patron} rewards already claimed"}, 400 - existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).one_or_none() + existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).first() if existing: return {"error": f"{patron} rewards already claimed on another account"}, 400 v.patron = tier diff --git a/files/routes/users.py b/files/routes/users.py index 8eeb982aa0..abc9a9342e 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -927,6 +927,7 @@ def u_username(username, v=None): abort(404) if v and v.id not in (u.id, DAD_ID) and u.viewers_recorded: + g.db.flush() view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none() if view: view.last_view_utc = int(time.time()) diff --git a/files/routes/votes.py b/files/routes/votes.py index b08338e85e..2965b734a9 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -159,7 +159,7 @@ def vote_comment(comment_id, new, v): coin_mult = 1 - g.db.flush() + g.db.commit() existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none() if DOUBLE_XP_ENABLED > 0: diff --git a/files/templates/expanded_image_modal.html b/files/templates/expanded_image_modal.html index 6e6f1e190f..c30c74ecb1 100644 --- a/files/templates/expanded_image_modal.html +++ b/files/templates/expanded_image_modal.html @@ -3,13 +3,13 @@ diff --git a/files/templates/submit.html b/files/templates/submit.html index 8efa49f5eb..f991317947 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -181,7 +181,7 @@ {% if FEATURES['COUNTRY_CLUB'] -%}
- +
{%- endif %} diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 1526c7ada2..22d8b30790 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 498, + 'css/main.css': 499, 'css/catalog.css': 2, 'css/4chan.css': 61,