From 2e39f547fafcbc70afdc7de9edc77393c06c658f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 24 Nov 2021 00:36:38 +0200 Subject: [PATCH] fdsfdsfd --- files/assets/css/main.css | 8 + files/assets/images/badges/Unblockable.webp | Bin 0 -> 14772 bytes files/classes/user.py | 2 + files/helpers/alerts.py | 5 +- files/helpers/const.py | 260 +++++++++++--------- files/routes/awards.py | 100 +++++--- files/routes/comments.py | 20 +- files/routes/posts.py | 25 +- files/routes/settings.py | 4 +- files/templates/authforms.html | 4 +- files/templates/award_modal.html | 2 +- files/templates/default.html | 4 +- files/templates/log.html | 4 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 +- files/templates/shop.html | 2 +- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 +- 20 files changed, 285 insertions(+), 171 deletions(-) create mode 100644 files/assets/images/badges/Unblockable.webp diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 2ee835609..4d80807dc 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5645,6 +5645,14 @@ blockquote p { color: green !important; } +.text-lightgreen { + color: lightgreen !important; +} + +.text-blue { + color: #1D9BF0 !important; +} + .timeline-Widget { max-height: 500px !important; overflow-y: scroll !important; diff --git a/files/assets/images/badges/Unblockable.webp b/files/assets/images/badges/Unblockable.webp new file mode 100644 index 0000000000000000000000000000000000000000..150f1724c8fc721f2f82f0f93bec1aea0b875868 GIT binary patch literal 14772 zcmY*=WmF!$6Yt_~#i6*nySux)yF10DxKrHSDemsY-HN+gp*TFZ@Be z&YnzWGWkVSMpCkd2LQArM3ps_xwYW|0QmB+EP?%(MHFQep#RnWZxT^dkW?iG08{{g z1%MPVpa~3ch5*3-^^@oQM`ubIut!~m<^tB(lb-7Z)G{pbgQv;^nZbK1&>n-o$@RnH(b8!ZPJ8o*HnK^K(phf$h2q<{rSK)$p zlSyF5iwQ3#WkQYH?N`C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+-Xd^pgiZce#qDKn1OyW)z#HKyy|ox zKXgj-y*Y3_L%lZRzXv>9a6QL;Jp6k2r9SU@Qjh=cha+Fw5g>@!QW##*@zl}F?r~JU z7QpqKseA)%R0!H}ygeEU^bE~M0j(o_9zNFHWZdCjVBfWE?N0s+oHpb8eR}|P4W$1w zs`&xFw@09!+g5zP`L|Z|&C^LxUq{as^gq)(G`Qg?EZ#=drBRbl=!CM>`vUwQgepD< literal 0 HcmV?d00001 diff --git a/files/classes/user.py b/files/classes/user.py index 858821356..dd9c6a716 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -51,6 +51,8 @@ class User(Base): verifiedcolor = Column(String) marseyawarded = Column(Integer) longpost = Column(Integer) + unblockable = Column(Boolean) + bird = Column(Integer) email = deferred(Column(String)) css = deferred(Column(String)) profilecss = deferred(Column(String)) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index bccde6608..97a2e1519 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -14,10 +14,7 @@ def send_notification(uid, text, autojanny=False): text_html = sanitize(text_html) if autojanny: author_id = AUTOJANNY_ID - else: - author_id = NOTIFICATIONS_ID - existing = g.db.query(Comment.id).filter(Comment.author_id == author_id, Comment.body_html == text_html, Comment.notifiedto == uid).first() - if existing: abort(403) + else: author_id = NOTIFICATIONS_ID new_comment = Comment(author_id=author_id, parent_submission=None, diff --git a/files/helpers/const.py b/files/helpers/const.py index 79052c318..2d3f1b5fb 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -356,121 +356,13 @@ BADGES = { 'name': 'Holly Jolly Marsey Artist', 'description': 'Contributed a VERY JOLLY Marsey for Christmas 2021!' }, + 87: { + 'name': 'Unblockable', + 'description': 'This user is unblockable' + }, } AWARDS = { - "shit": { - "kind": "shit", - "title": "Shit", - "description": "Makes flies swarm the post.", - "icon": "fas fa-poop", - "color": "text-black-50", - "price": 500 - }, - "fireflies": { - "kind": "fireflies", - "title": "Fireflies", - "description": "Makes fireflies swarm the post.", - "icon": "fas fa-sparkles", - "color": "text-warning", - "price": 500 - }, - "train": { - "kind": "train", - "title": "Train", - "description": "Summons a train on the post.", - "icon": "fas fa-train", - "color": "text-pink", - "price": 500 - }, - "pin": { - "kind": "pin", - "title": "1-Hour Pin", - "description": "Pins the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-warning", - "price": 750 - }, - "unpin": { - "kind": "unpin", - "title": "1-Hour Unpin", - "description": "Removes 1 hour from the pin duration of the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-black", - "price": 1000 - }, - "flairlock": { - "kind": "flairlock", - "title": "1-Day Flairlock", - "description": "Sets a flair for the recipient and locks it or 24 hours.", - "icon": "fas fa-lock", - "color": "text-black", - "price": 1250 - }, - "pizzashill": { - "kind": "pizzashill", - "title": "Pizzashill", - "description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.", - "icon": "fas fa-pizza-slice", - "color": "text-orange", - "price": 1500 - }, - "agendaposter": { - "kind": "agendaposter", - "title": "Agendaposter", - "description": "Forces the agendaposter theme on the recipient for 24 hours.", - "icon": "fas fa-snooze", - "color": "text-purple", - "price": 2500 - }, - "marsey": { - "kind": "marsey", - "title": "Marsey", - "description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.", - "icon": "fas fa-cat", - "color": "text-orange", - "price": 3000 - }, - "ban": { - "kind": "ban", - "title": "1-Day Ban", - "description": "Bans the recipient for a day.", - "icon": "fas fa-gavel", - "color": "text-danger", - "price": 3000 - }, - "unban": { - "kind": "unban", - "title": "1-Day Unban", - "description": "Removes 1 day from the ban duration of the recipient.", - "icon": "fas fa-gavel", - "color": "text-success", - "price": 3500 - }, - "grass": { - "kind": "grass", - "title": "Grass", - "description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)", - "icon": "fas fa-seedling", - "color": "text-success", - "price": 10000 - }, - "pause": { - "kind": "pause", - "title": "Pause", - "description": "Gives the recipient the ability to pause profile anthems.", - "icon": "fas fa-volume-mute", - "color": "text-danger", - "price": 20000 - }, - "unpausable": { - "kind": "unpausable", - "title": "Unpausable", - "description": "Makes the profile anthem of the recipient unpausable.", - "icon": "fas fa-volume", - "color": "text-success", - "price": 40000 - }, "haunt": { "kind": "haunt", "title": "Haunt", @@ -527,6 +419,110 @@ AWARDS = { "color": "text-orange", "price": 1000 }, + "shit": { + "kind": "shit", + "title": "Shit", + "description": "Makes flies swarm the post.", + "icon": "fas fa-poop", + "color": "text-black-50", + "price": 500 + }, + "fireflies": { + "kind": "fireflies", + "title": "Fireflies", + "description": "Makes fireflies swarm the post.", + "icon": "fas fa-sparkles", + "color": "text-warning", + "price": 500 + }, + "train": { + "kind": "train", + "title": "Train", + "description": "Summons a train on the post.", + "icon": "fas fa-train", + "color": "text-pink", + "price": 500 + }, + "pin": { + "kind": "pin", + "title": "1-Hour Pin", + "description": "Pins the post/comment.", + "icon": "fas fa-thumbtack fa-rotate--45", + "color": "text-warning", + "price": 750 + }, + "unpin": { + "kind": "unpin", + "title": "1-Hour Unpin", + "description": "Removes 1 hour from the pin duration of the post/comment.", + "icon": "fas fa-thumbtack fa-rotate--45", + "color": "text-black", + "price": 1000 + }, + "flairlock": { + "kind": "flairlock", + "title": "1-Day Flairlock", + "description": "Sets a flair for the recipient and locks it or 24 hours.", + "icon": "fas fa-lock", + "color": "text-black", + "price": 1250 + }, + "pizzashill": { + "kind": "pizzashill", + "title": "Pizzashill", + "description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.", + "icon": "fas fa-pizza-slice", + "color": "text-orange", + "price": 1500 + }, + "bird": { + "kind": "bird", + "title": "Bird Site", + "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", + "icon": "fab fa-twitter", + "color": "text-blue", + "price": 1500 + }, + "agendaposter": { + "kind": "agendaposter", + "title": "Agendaposter", + "description": "Forces the agendaposter theme on the recipient for 24 hours.", + "icon": "fas fa-snooze", + "color": "text-purple", + "price": 2500 + }, + "marsey": { + "kind": "marsey", + "title": "Marsey", + "description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.", + "icon": "fas fa-cat", + "color": "text-orange", + "price": 3000 + }, + "ban": { + "kind": "ban", + "title": "1-Day Ban", + "description": "Bans the recipient for a day.", + "icon": "fas fa-gavel", + "color": "text-danger", + "price": 3000 + }, + "unban": { + "kind": "unban", + "title": "1-Day Unban", + "description": "Removes 1 day from the ban duration of the recipient.", + "icon": "fas fa-gavel", + "color": "text-success", + "price": 3500 + }, + "grass": { + "kind": "grass", + "title": "Grass", + "description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)", + "icon": "fas fa-seedling", + "color": "text-success", + "price": 10000 + }, "eye": { "kind": "eye", "title": "All-Seeing Eye", @@ -535,6 +531,30 @@ AWARDS = { "color": "text-silver", "price": 10000 }, + "pause": { + "kind": "pause", + "title": "Pause", + "description": "Gives the recipient the ability to pause profile anthems.", + "icon": "fas fa-volume-mute", + "color": "text-danger", + "price": 20000 + }, + "unblockable": { + "kind": "unblockable", + "title": "Unblockable", + "description": "Makes the recipient unblockable and removes all blocks on them.", + "icon": "far fa-laugh-squint", + "color": "text-lightgreen", + "price": 25000 + }, + "unpausable": { + "kind": "unpausable", + "title": "Unpausable", + "description": "Makes the profile anthem of the recipient unpausable.", + "icon": "fas fa-volume", + "color": "text-success", + "price": 40000 + }, "alt": { "kind": "alt", "title": "Alt-Seeing Eye", @@ -603,6 +623,14 @@ AWARDS2 = { "color": "text-orange", "price": 1500 }, + "bird": { + "kind": "bird", + "title": "Bird Site", + "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", + "icon": "fab fa-twitter", + "color": "text-blue", + "price": 1500 + }, "agendaposter": { "kind": "agendaposter", "title": "Agendaposter", @@ -659,6 +687,14 @@ AWARDS2 = { "color": "text-danger", "price": 20000 }, + "unblockable": { + "kind": "unblockable", + "title": "Unblockable", + "description": "Makes the recipient unblockable and removes all blocks on them.", + "icon": "far fa-laugh-squint", + "color": "text-lightgreen", + "price": 25000 + }, "unpausable": { "kind": "unpausable", "title": "Unpausable", diff --git a/files/routes/awards.py b/files/routes/awards.py index 86c5ab638..b0c2d3a65 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -55,8 +55,7 @@ def shop(v): "icon": "fas fa-poop", "color": "text-black-50", "owned": 0, - "price": 500, - "MB": True + "price": 500 }, "fireflies": { "kind": "fireflies", @@ -65,8 +64,7 @@ def shop(v): "icon": "fas fa-sparkles", "color": "text-warning", "owned": 0, - "price": 500, - "MB": True + "price": 500 }, "train": { "kind": "train", @@ -75,8 +73,7 @@ def shop(v): "icon": "fas fa-train", "color": "text-pink", "owned": 0, - "price": 500, - "MB": True + "price": 500 }, "pin": { "kind": "pin", @@ -85,8 +82,7 @@ def shop(v): "icon": "fas fa-thumbtack fa-rotate--45", "color": "text-warning", "owned": 0, - "price": 750, - "MB": True + "price": 750 }, "unpin": { "kind": "unpin", @@ -95,8 +91,7 @@ def shop(v): "icon": "fas fa-thumbtack fa-rotate--45", "color": "text-black", "owned": 0, - "price": 1000, - "MB": True + "price": 1000 }, "flairlock": { "kind": "flairlock", @@ -105,8 +100,7 @@ def shop(v): "icon": "fas fa-lock", "color": "text-black", "owned": 0, - "price": 1250, - "MB": True + "price": 1250 }, "pizzashill": { "kind": "pizzashill", @@ -115,8 +109,16 @@ def shop(v): "icon": "fas fa-pizza-slice", "color": "text-orange", "owned": 0, - "price": 1500, - "MB": True + "price": 1500 + }, + "bird": { + "kind": "bird", + "title": "Bird Site", + "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", + "icon": "fab fa-twitter", + "color": "text-blue", + "owned": 0, + "price": 1500 }, "agendaposter": { "kind": "agendaposter", @@ -125,8 +127,7 @@ def shop(v): "icon": "fas fa-snooze", "color": "text-purple", "owned": 0, - "price": 2500, - "MB": True + "price": 2500 }, "marsey": { "kind": "marsey", @@ -135,8 +136,7 @@ def shop(v): "icon": "fas fa-cat", "color": "text-orange", "owned": 0, - "price": 3000, - "MB": True + "price": 3000 }, "ban": { "kind": "ban", @@ -145,8 +145,7 @@ def shop(v): "icon": "fas fa-gavel", "color": "text-danger", "owned": 0, - "price": 3000, - "MB": True + "price": 3000 }, "unban": { "kind": "unban", @@ -155,8 +154,7 @@ def shop(v): "icon": "fas fa-gavel", "color": "text-success", "owned": 0, - "price": 3500, - "MB": True + "price": 3500 }, "grass": { "kind": "grass", @@ -165,8 +163,7 @@ def shop(v): "icon": "fas fa-seedling", "color": "text-success", "owned": 0, - "price": 10000, - "MB": False + "price": 10000 }, "eye": { "kind": "eye", @@ -175,8 +172,7 @@ def shop(v): "icon": "fas fa-eye", "color": "text-silver", "owned": 0, - "price": 10000, - "MB": False + "price": 10000 }, "pause": { "kind": "pause", @@ -185,8 +181,16 @@ def shop(v): "icon": "fas fa-volume-mute", "color": "text-danger", "owned": 0, - "price": 20000, - "MB": False + "price": 20000 + }, + "unblockable": { + "kind": "unblockable", + "title": "Unblockable", + "description": "Makes the recipient unblockable and removes all blocks on them.", + "icon": "far fa-laugh-squint", + "color": "text-lightgreen", + "owned": 0, + "price": 25000 }, "unpausable": { "kind": "unpausable", @@ -195,8 +199,7 @@ def shop(v): "icon": "fas fa-volume", "color": "text-success", "owned": 0, - "price": 40000, - "MB": False + "price": 40000 }, "alt": { "kind": "alt", @@ -205,8 +208,7 @@ def shop(v): "icon": "fas fa-eye", "color": "text-gold", "owned": 0, - "price": 50000, - "MB": False + "price": 50000 }, } @@ -290,6 +292,14 @@ def buy(v, award): "color": "text-orange", "price": 1500, }, + "bird": { + "kind": "bird", + "title": "Bird Site", + "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", + "icon": "fab fa-twitter", + "color": "text-blue", + "price": 1500 + }, "agendaposter": { "kind": "agendaposter", "title": "Agendaposter", @@ -346,6 +356,14 @@ def buy(v, award): "color": "text-danger", "price": 20000 }, + "unblockable": { + "kind": "unblockable", + "title": "Unblockable", + "description": "Makes the recipient unblockable and removes all blocks on them.", + "icon": "far fa-laugh-squint", + "color": "text-lightgreen", + "price": 25000 + }, "unpausable": { "kind": "unpausable", "title": "Unpausable", @@ -542,6 +560,9 @@ def award_post(pid, v): if author.longpost: author.longpost += 86400 else: author.longpost = time.time() + 86400 send_notification(IDIO_ID, f"@{v.username} used {kind} award on {request.host_url}{post.shortlink}") + elif kind == "bird": + if author.bird: author.bird += 86400 + else: author.bird = time.time() + 86400 elif kind == "eye": author.eye = True send_notification(CARP_ID, f"@{v.username} used {kind} award!") @@ -552,6 +573,12 @@ def award_post(pid, v): send_notification(CARP_ID, f"@{v.username} used {kind} award!") new_badge = Badge(badge_id=84, user_id=author.id) g.db.add(new_badge) + elif kind == "unblockable": + author.unblockable = True + send_notification(CARP_ID, f"@{v.username} used {kind} award!") + new_badge = Badge(badge_id=87, user_id=author.id) + g.db.add(new_badge) + for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block) post.author.received_award_count += 1 g.db.add(post.author) @@ -676,6 +703,9 @@ def award_comment(cid, v): if author.longpost: author.longpost += 86400 else: author.longpost = time.time() + 86400 send_notification(IDIO_ID, f"@{v.username} used {kind} award on {request.host_url}{c.shortlink}") + elif kind == "bird": + if author.bird: author.bird += 86400 + else: author.bird = time.time() + 86400 elif kind == "eye": author.eye = True send_notification(CARP_ID, f"@{v.username} used {kind} award!") @@ -686,6 +716,12 @@ def award_comment(cid, v): send_notification(CARP_ID, f"@{v.username} used {kind} award!") new_badge = Badge(badge_id=84, user_id=author.id) g.db.add(new_badge) + elif kind == "unblockable": + author.unblockable = True + send_notification(CARP_ID, f"@{v.username} used {kind} award!") + new_badge = Badge(badge_id=87, user_id=author.id) + g.db.add(new_badge) + for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block) c.author.received_award_count += 1 g.db.add(c.author) diff --git a/files/routes/comments.py b/files/routes/comments.py index 512dde20a..65482b3a3 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -169,6 +169,11 @@ def api_comment(v): v.longpost = None g.db.add(v) elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if time.time() > v.bird: + v.bird = None + g.db.add(v) + elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403 if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400 @@ -194,7 +199,10 @@ def api_comment(v): if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403 - if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403 + if v.longpost: + if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403 bans = filter_comment_html(body_html) @@ -627,6 +635,11 @@ def edit_comment(cid, v): v.longpost = None g.db.add(v) elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if time.time() > v.bird: + v.bird = None + g.db.add(v) + elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403 for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') @@ -635,7 +648,10 @@ def edit_comment(cid, v): if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403 - if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403 + if v.longpost: + if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403 bans = filter_comment_html(body_html) diff --git a/files/routes/posts.py b/files/routes/posts.py index caf714d93..6e86b6e26 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -242,6 +242,11 @@ def edit_post(pid, v): v.longpost = None g.db.add(v) elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if time.time() > v.bird: + v.bird = None + g.db.add(v) + elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403 if title != p.title: title_html = filter_title(title) @@ -267,7 +272,10 @@ def edit_post(pid, v): p.body = body if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 40 - if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403 + if v.longpost: + if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403 p.body_html = body_html @@ -532,7 +540,10 @@ def submit_post(v): if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40 - if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403 + if v.longpost: + if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403 if url: if "/i.imgur.com/" in url: url = url.replace(".png", ".webp").replace(".jpg", ".webp").replace(".jpeg", ".webp") @@ -621,6 +632,11 @@ def submit_post(v): v.longpost = None g.db.add(v) elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if time.time() > v.bird: + v.bird = None + g.db.add(v) + elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403 dup = g.db.query(Submission).filter( Submission.author_id == v.id, @@ -703,7 +719,10 @@ def submit_post(v): if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 400 - if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403 + if v.longpost: + if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403 + elif v.bird: + if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403 if len(body_html) > 20000: return {"error":"Submission body too long!"}, 400 diff --git a/files/routes/settings.py b/files/routes/settings.py index e63a2f8d8..e06834f40 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -825,6 +825,8 @@ def settings_block_user(v): user = get_user(request.values.get("username"), graceful=True) + if user.unblockable: return {"error": "This user is unblockable."}, 403 + if not user: return {"error": "That user doesn't exist."}, 404 @@ -869,8 +871,6 @@ def settings_unblock_user(v): g.db.delete(x) - - existing = g.db.query(Notification.id).filter_by(unblocksender=v.id, user_id=user.id).first() if not existing: send_unblock_notif(v.id, user.id, f"@{v.username} has unblocked you!") diff --git a/files/templates/authforms.html b/files/templates/authforms.html index a176381e3..979f5dda6 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index afda87db9..ce9a348ce 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -72,7 +72,7 @@ @media (min-width: 767.98px) { .award-columns { - column-count: 8 !important; + column-count: 9 !important; } } \ No newline at end of file diff --git a/files/templates/default.html b/files/templates/default.html index 398529dc0..4061e6d55 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -252,12 +252,12 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/log.html b/files/templates/log.html index e45c78304..b71e6e7ad 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -17,11 +17,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 6781d1cc9..34878efc6 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index e296ec3cb..99e9a6c37 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -55,7 +55,7 @@ - + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index a602feb71..d70510339 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/shop.html b/files/templates/shop.html index 34b21f03a..014c186ca 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -64,7 +64,7 @@ {% set kind = a['kind'] %} Buy - {% if v.procoins and a['MB'] %}Buy with Marseybux{% endif %} + {% if v.procoins and a['price'] > 3500 %}Buy with Marseybux{% endif %} {% endfor %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index f34083b0c..c7ced7288 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -36,7 +36,7 @@ - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 9828df0f0..d9b685f18 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 7a0075953..255d64038 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -31,11 +31,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %}