From d8cf302a43bdf949613aa13a641996bdfa1e6447 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 15 Mar 2023 06:21:52 +0200 Subject: [PATCH] remove hidevotedon --- files/classes/user.py | 1 - files/routes/front.py | 6 ------ files/routes/settings.py | 1 - files/templates/settings/advanced.html | 1 - migrations/20230315-remove-hidevotedon.sql | 1 + schema.sql | 2 -- 6 files changed, 1 insertion(+), 11 deletions(-) create mode 100644 migrations/20230315-remove-hidevotedon.sql diff --git a/files/classes/user.py b/files/classes/user.py index 6f91acef5..c45f8fa27 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -106,7 +106,6 @@ class User(Base): shadowbanned = Column(Integer, ForeignKey("users.id")) chudded_by = Column(Integer, ForeignKey("users.id")) over_18 = Column(Boolean, default=False) - hidevotedon = Column(Boolean, default=False) slurreplacer = Column(Integer, default=1) profanityreplacer = Column(Integer, default=1) flairchanged = Column(Integer) diff --git a/files/routes/front.py b/files/routes/front.py index 24dd6aa7f..981cab3a4 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -66,7 +66,6 @@ def front_all(v, sub=None, subdomain=None): posts = get_posts(ids, v=v, eager=True) if v: - if v.hidevotedon: posts = [x for x in posts if not hasattr(x, 'voted') or not x.voted] award_timers(v) if v and v.client: return {"data": [x.json(g.db) for x in posts], "next_exists": next_exists} @@ -79,11 +78,6 @@ LIMITED_WPD_HOLES = ('gore', 'aftermath', 'selfharm', 'meta', 'discussion', 'soc def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', gt=0, lt=0, sub=None, site=None, pins=True, holes=True): posts = g.db.query(Submission) - if v and v.hidevotedon: - posts = posts.outerjoin(Vote, - and_(Vote.submission_id == Submission.id, Vote.user_id == v.id) - ).filter(Vote.submission_id == None) - if sub: posts = posts.filter(Submission.sub == sub.name) elif v: posts = posts.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks))) diff --git a/files/routes/settings.py b/files/routes/settings.py index 3ad682708..48bd8dcbe 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -183,7 +183,6 @@ def settings_personal_post(v): g.db.add(v) return profanity_filter_updated - updated = updated or update_flag("hidevotedon", "hidevotedon") updated = updated or update_flag("newtab", "newtab") updated = updated or update_flag("newtabexternal", "newtabexternal") updated = updated or update_flag("nitter", "nitter") diff --git a/files/templates/settings/advanced.html b/files/templates/settings/advanced.html index 22472fb9d..5da130f7d 100644 --- a/files/templates/settings/advanced.html +++ b/files/templates/settings/advanced.html @@ -132,7 +132,6 @@ {% if FEATURES['NSFW_MARKING'] %} {{common.toggle_section('Disable +18 Warnings', 'over_18', 'over_18', v.over_18, "Disable the warnings that appear when viewing +18 content.", false)}} {% endif %} - {{common.toggle_section('Hide Posts Voted On', 'hidevotedon', 'hidevotedon', v.hidevotedon, 'Enable if you would like to automatically hide posts you have voted on from your frontpage.', false)}}
diff --git a/migrations/20230315-remove-hidevotedon.sql b/migrations/20230315-remove-hidevotedon.sql new file mode 100644 index 000000000..6eae93ce3 --- /dev/null +++ b/migrations/20230315-remove-hidevotedon.sql @@ -0,0 +1 @@ +alter table users drop column hidevotedon; diff --git a/schema.sql b/schema.sql index 1e3c01a93..a51a2d05e 100644 --- a/schema.sql +++ b/schema.sql @@ -984,7 +984,6 @@ CREATE TABLE public.users ( titlecolor character varying(6) NOT NULL, profileurl character varying(65), bannerurl character varying(65), - hidevotedon boolean DEFAULT false NOT NULL, newtab boolean DEFAULT false NOT NULL, flairchanged integer, defaultsortingcomments character varying(15) NOT NULL, @@ -2880,4 +2879,3 @@ ALTER TABLE ONLY public.comments -- -- PostgreSQL database dump complete -- -