diff --git a/files/classes/comment.py b/files/classes/comment.py index cb39a4b20..8e3a899cf 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -375,9 +375,6 @@ class Comment(Base): g.db.add(self) g.db.commit() - if self.author.sig_html and (self.author_id == MOOSE_ID or (not self.ghost and not (v and v.sigs_disabled))): - body += f"
{self.author.sig_html}" - return body def plainbody(self, v): diff --git a/files/classes/submission.py b/files/classes/submission.py index 48583f545..9e529a92a 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -377,9 +377,6 @@ class Submission(Base): g.db.add(self) g.db.commit() - if self.author.sig_html and (self.author_id == MOOSE_ID or (not self.ghost and not (v and v.sigs_disabled))): - body += f"
{self.author.sig_html}" - return body def plainbody(self, v): diff --git a/files/classes/user.py b/files/classes/user.py index d01a11210..fca670ba2 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -95,10 +95,7 @@ class User(Base): controversial = Column(Boolean, default=False, nullable=False) bio = deferred(Column(String)) bio_html = Column(String) - sig = deferred(Column(String)) - sig_html = Column(String) fp = Column(String) - sigs_disabled = Column(Boolean) fish = Column(Boolean) progressivestack = Column(Integer) deflector = Column(Integer) diff --git a/files/helpers/const.py b/files/helpers/const.py index ba80087f1..35af2f10c 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -35,7 +35,6 @@ PIZZA_VOTERS = () IDIO_ID = 0 CARP_ID = 0 JOAN_ID = 0 -MOOSE_ID = 0 AEVANN_ID = 9 HOMO_ID = 0 SOREN_ID = 0 diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 602c2eda9..a52a7e829 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -61,7 +61,6 @@ def inject_constants(): "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, - "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, diff --git a/files/routes/settings.py b/files/routes/settings.py index 99ab9e0b8..efb405a16 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -78,10 +78,6 @@ def settings_profile_post(v): updated = True v.controversial = request.values.get("controversial") == 'true' - elif request.values.get("sigs_disabled", v.sigs_disabled) != v.sigs_disabled: - updated = True - v.sigs_disabled = request.values.get("sigs_disabled") == 'true' - elif request.values.get("over18", v.over_18) != v.over_18: updated = True v.over_18 = request.values.get("over18") == 'true' @@ -101,13 +97,6 @@ def settings_profile_post(v): g.db.commit() return render_template("settings_profile.html", v=v, msg="Your bio has been updated.") - elif request.values.get("sig") == "": - v.sig = None - v.sig_html = None - g.db.add(v) - g.db.commit() - return render_template("settings_profile.html", v=v, msg="Your sig has been updated.") - elif request.values.get("friends") == "": v.friends = None v.friends_html = None @@ -122,27 +111,6 @@ def settings_profile_post(v): g.db.commit() return render_template("settings_profile.html", v=v, msg="Your enemies list has been updated.") - elif (v.patron or v.id == MOOSE_ID) and request.values.get("sig"): - sig = request.values.get("sig")[:200] - - sig_html = sanitize(sig) - - if len(sig_html) > 1000: - return render_template("settings_profile.html", - v=v, - error="Your sig is too long") - - v.sig = sig[:200] - v.sig_html=sig_html - g.db.add(v) - g.db.commit() - return render_template("settings_profile.html", - v=v, - msg="Your sig has been updated.") - - - - elif request.values.get("friends"): friends = request.values.get("friends")[:500] diff --git a/files/templates/settings_filters.html b/files/templates/settings_filters.html index 9baa0a555..477542a8a 100644 --- a/files/templates/settings_filters.html +++ b/files/templates/settings_filters.html @@ -219,28 +219,6 @@
- -
- -
- -
- -
- -
- - -
- - Hide user signatures. - -
- -
- - -
diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 85bd5ea26..2e45cafe1 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -421,35 +421,6 @@
- {% if v.patron or v.id == MOOSE_ID %} -
- - -
-
- -
- -
-
- -   - -   - -   - -
-

-										
- Limit of 200 characters - -
-
-
- -
- {% endif %}
diff --git a/migrations/versions/2022_11_06_22_06_07_61c6f838c5c6_remove_signatures_feature.py b/migrations/versions/2022_11_06_22_06_07_61c6f838c5c6_remove_signatures_feature.py new file mode 100644 index 000000000..b7fa89505 --- /dev/null +++ b/migrations/versions/2022_11_06_22_06_07_61c6f838c5c6_remove_signatures_feature.py @@ -0,0 +1,32 @@ +"""remove signatures feature + +Revision ID: 61c6f838c5c6 +Revises: 44a40481ca2b +Create Date: 2022-11-06 22:06:07.735203+00:00 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '61c6f838c5c6' +down_revision = '44a40481ca2b' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('users', 'sigs_disabled') + op.drop_column('users', 'sig_html') + op.drop_column('users', 'sig') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('users', sa.Column('sig', sa.VARCHAR(length=200), autoincrement=False, nullable=True)) + op.add_column('users', sa.Column('sig_html', sa.VARCHAR(length=1000), autoincrement=False, nullable=True)) + op.add_column('users', sa.Column('sigs_disabled', sa.BOOLEAN(), autoincrement=False, nullable=True)) + # ### end Alembic commands ###