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 %}
Choose your quadrant.
-{% if u.quadrant %}{% endif %}{{u.customtitle | safe}}
{{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 %}{% endif %}{{u.customtitle | safe}}
{{u.customtitle | safe}}
{% else %} {% endif %}