From dc19d1fce969e854524a612105d2b387409eb1ff Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 4 Jan 2022 19:21:30 +0200 Subject: [PATCH] dg --- files/routes/users.py | 8 ++++++++ files/templates/authforms.html | 4 ++-- files/templates/default.html | 4 ++-- files/templates/header.html | 2 +- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- 12 files changed, 24 insertions(+), 16 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index a1808a371..6d4dbb2a5 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -402,6 +402,10 @@ def message2(v, username): if v.admin_level <= 1 and hasattr(user, 'is_blocked') and user.is_blocked: return {"error": "This user is blocking you."}, 403 + if v.is_banned and not v.unban_utc: return render_template('errors/500.html', error=True, v=v), 500 + + if v.shadowbanned: return redirect(f"/@{username}") + message = request.values.get("message", "").strip()[:1000].strip() if 'linkedin.com' in message: return {"error": "this domain 'linkedin.com' is banned"} @@ -466,6 +470,10 @@ def message3(v, username): if v.admin_level <= 1 and hasattr(user, 'is_blocked') and user.is_blocked: return {"error": "This user is blocking you."}, 403 + if v.is_banned and not v.unban_utc: return {"error": "Internal server error"}, 500 + + if v.shadowbanned: return {"message": "Message sent!"} + message = request.values.get("message", "").strip()[:1000].strip() if 'linkedin.com' in message: return {"error": "This domain 'linkedin.com' is banned."}, 403 diff --git a/files/templates/authforms.html b/files/templates/authforms.html index b435e6e2a..7d3d085be 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 e1926dc2f..3b3940ed4 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/header.html b/files/templates/header.html index ce46ad9ed..bcc5f5f0a 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -1,7 +1,7 @@