(.+)<\/a>'
+ for url_match in re.finditer(url_regex, new_post.body_html):
href = url_match.group(3)
if not href: continue
title = url_match.group(5)
- if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"
+ if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"
- if f'**[{title}]({href})**:\n\n' in body: continue
- body += f'**[{title}]({href})**:\n\n'
- if href.startswith('https://old.reddit.com/'):
- body += f'* [unddit.com](https://unddit.com/{href.replace("https://old.reddit.com/", "")})\n'
- body += f'* [archive.org](https://web.archive.org/{href})\n'
- body += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n\n'
- gevent.spawn(archiveorg, href)
+ if f'**[{title}]({href})**:\n\n' not in body:
+ body += f'**[{title}]({href})**:\n\n'
+ if href.startswith('https://old.reddit.com/'):
+ body += f'* [unddit.com](https://unddit.com/{href.replace("https://old.reddit.com/", "")})\n'
+ body += f'* [archive.org](https://web.archive.org/{href})\n'
+ body += f'* [archive.ph](https://archive.ph/?url={quote(href)}&run=1) (click to archive)\n\n'
+ gevent.spawn(archiveorg, href)
body_html = sanitize(body)
diff --git a/files/routes/users.py b/files/routes/users.py
index b54e39f29..e6100f3aa 100644
--- a/files/routes/users.py
+++ b/files/routes/users.py
@@ -361,7 +361,7 @@ def leaderboard(v):
sq = g.db.query(Badge.user_id, func.count(Badge.user_id).label("count"), func.rank().over(order_by=func.count(Badge.user_id).desc()).label("rank")).group_by(Badge.user_id).subquery()
users11 = g.db.query(User, sq.c.count).join(sq, User.id==sq.c.user_id).order_by(sq.c.count.desc()).limit(25).all()
- pos11 = g.db.query(User, sq.c.rank, sq.c.count).join(sq, User.id==sq.c.user_id).filter(User.id == v.id).one()
+ pos11 = g.db.query(User.id, sq.c.rank, sq.c.count).join(sq, User.id==sq.c.user_id).filter(User.id == v.id).one()
pos11 = (pos11[1],pos11[2])
try:
diff --git a/files/templates/authforms.html b/files/templates/authforms.html
index b18af1559..921680209 100644
--- a/files/templates/authforms.html
+++ b/files/templates/authforms.html
@@ -15,7 +15,7 @@
{% if v %}
-
+
{% if v.agendaposter %}
-
+
{% endif %}
diff --git a/files/templates/default.html b/files/templates/default.html
index 485d63276..b83a0e5dc 100644
--- a/files/templates/default.html
+++ b/files/templates/default.html
@@ -7,7 +7,7 @@
{% if v %}
-
+
{% if v.agendaposter %}
-
+
{% endif %}
diff --git a/files/templates/log.html b/files/templates/log.html
index ad83ccaec..84841813e 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 85a542ae5..7063169dd 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 2566e1204..9ba4654a1 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/settings.html b/files/templates/settings.html
index a305dc489..1a30655c4 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/sign_up.html b/files/templates/sign_up.html
index e36a73d77..b927f5752 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 f9dbacf17..04855c638 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/submit.html b/files/templates/submit.html
index e31e08832..d02d803db 100644
--- a/files/templates/submit.html
+++ b/files/templates/submit.html
@@ -26,7 +26,7 @@
{% block stylesheets %}
{% if v %}
-
+
{% if v.agendaposter %}
-
+
{% endif %}
{% endblock %}