diff --git a/files/classes/user.py b/files/classes/user.py index 3290e3299b..369193d714 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -30,7 +30,6 @@ class User(Base): __tablename__ = "users" if SITE == "pcmemes.net": - quadrant = Column(String) basedcount = Column(Integer, default=0) pills = deferred(Column(String, default="")) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 2905a840ad..211563b8f4 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -46,7 +46,12 @@ def notif_comment(text, autojanny=False): text_html = sanitize(text, alert=True) - existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none() + try: existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none() + except: + existing = g.db.query(Comment).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).all() + for c in existing: g.db.delete(c) + g.db.flush() + existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none() if existing: return existing[0] else: return create_comment(text_html, autojanny) diff --git a/files/helpers/const.py b/files/helpers/const.py index f1403be535..73e6105e24 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -153,7 +153,7 @@ elif SITE == "pcmemes.net": SNAPPY_ID = 261 LONGPOSTBOT_ID = 1832 ZOZBOT_ID = 1833 - AUTOPOLLER_ID = 3369 + AUTOPOLLER_ID = 2129 AUTOBETTER_ID = 1867 AUTOCHOICE_ID = 2072 BASEDBOT_ID = 800 diff --git a/files/routes/settings.py b/files/routes/settings.py index 74329e6850..63538ae96b 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -348,40 +348,6 @@ def settings_profile_post(v): updated = True - quadrant = request.values.get("quadrant") - if quadrant and request.host == 'pcmemes.net'.lower(): - v.quadrant = quadrant - v.customtitle = quadrant - if quadrant=="Centrist": - v.namecolor = "7f8fa6" - v.titlecolor = "7f8fa6" - elif quadrant=="LibLeft": - v.namecolor = "62ca56" - v.titlecolor = "62ca56" - elif quadrant=="LibRight": - v.namecolor = "f8db58" - v.titlecolor = "f8db58" - elif quadrant=="AuthLeft": - v.namecolor = "ff0000" - v.titlecolor = "ff0000" - elif quadrant=="AuthRight": - v.namecolor = "2a96f3" - v.titlecolor = "2a96f3" - elif quadrant=="LibCenter": - v.namecolor = "add357" - v.titlecolor = "add357" - elif quadrant=="AuthCenter": - v.namecolor = "954b7a" - v.titlecolor = "954b7a" - elif quadrant=="Left": - v.namecolor = "b1652b" - v.titlecolor = "b1652b" - elif quadrant=="Right": - v.namecolor = "91b9A6" - v.titlecolor = "91b9A6" - - updated = True - if updated: g.db.add(v) g.db.commit() diff --git a/files/routes/static.py b/files/routes/static.py index d46b136b50..55c78bd870 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -19,7 +19,10 @@ def privacy(v): @auth_required def marseys(v): if SITE_NAME == 'Drama': - marseys = g.db.query(Marsey, User).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc()) + marseys = g.db.query(Marsey, User).join(User, User.id==Marsey.author_id) + sort = request.values.get("sort", "usage") + if sort == "usage": marseys = marseys.order_by(Marsey.count.desc()) + else: marseys = marseys.order_by(User.username) else: marseys = g.db.query(Marsey).order_by(Marsey.count.desc()) return render_template("marseys.html", v=v, marseys=marseys) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index df5df78e84..53d41840aa 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %} - + {% endif %} {% if v.agendaposter %} @@ -35,9 +35,9 @@ {% endif %} {% else %} - + {% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %} - + {% endif %} {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index fbef4012cb..618864527b 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 1c9009ac3b..c3fefa6b2d 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index c9324afa3b..2a340f9a05 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/marseys.html b/files/templates/marseys.html index fea3b2da62..af545a9520 100644 --- a/files/templates/marseys.html +++ b/files/templates/marseys.html @@ -10,8 +10,8 @@ # Name Marsey - Usage - {% if SITE_NAME == 'Drama' %}Author{% endif %} + Usage + {% if SITE_NAME == 'Drama' %}Author{% endif %} diff --git a/files/templates/settings.html b/files/templates/settings.html index 1f1a169d96..986aa313ca 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 85dd33c52c..da0a74bffe 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -10,38 +10,6 @@
- {% if request.host == "pcmemes.net".lower() %} - -

Quadrant

- -
- -
-
- -
- -
-

Choose your quadrant.

-
- -
- -
- -
-
- {% endif %} - - - - {% if SITE_NAME == 'Drama' %}

House

diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 59a2089694..be0d4ae93b 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index d8cd8d495a..7911c9cef3 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submission.html b/files/templates/submission.html index b3a7d53f46..32b98cb43c 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -632,7 +632,7 @@ {% if p.author.verified %} {% endif %} - {{p.author_name}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{{p.author.quadrant}} quadrant{% endif %}{{p.author.customtitle | safe}}{% endif %} + {{p.author_name}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %} {% endif %}  {{p.age_string}} ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.domain %}{{p.domain}}{% else %}text post{% endif %}) diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 965b1a317a..6d9a3e2779 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -200,7 +200,7 @@ {% if p.author.verified %} {% endif %} - {{p.author_name}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{{p.author.quadrant}} quadrant{% endif %}{{p.author.customtitle | safe}}{% endif %} + {{p.author_name}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %} {% endif %}  {{p.age_string}}   diff --git a/files/templates/submit.html b/files/templates/submit.html index d075fa8dc4..046f1c478c 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 023c7328f8..dfed1db039 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -104,7 +104,7 @@
- {% if u.customtitle %}

{% if u.quadrant %}{{u.quadrant}} quadrant{% endif %}{{u.customtitle | safe}}

+ {% if u.customtitle %}

{{u.customtitle | safe}}

{% else %}

 				{% endif %}
 
@@ -399,7 +399,7 @@
 				{% if v and v.has_follower(u) and not v.is_nofollow %}
 					Follows you
 				{% endif %}
-				{% if u.customtitle %}

{% if u.quadrant %}@{{u.quadrant}} quadrant{% endif %}{{u.customtitle | safe}}

+ {% if u.customtitle %}

{{u.customtitle | safe}}

{% else %}

 				{% endif %}