From 605015f812560c1277408b570c027a3027003d1c Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 12 Jan 2023 16:43:08 +0000 Subject: [PATCH] Update blocked site message --- app/blueprints/packages/reviews.py | 2 +- app/blueprints/threads/__init__.py | 6 +++--- app/blueprints/users/settings.py | 2 +- app/logic/packages.py | 2 +- app/utils/__init__.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/blueprints/packages/reviews.py b/app/blueprints/packages/reviews.py index b3ae9697..b4c0dd6b 100644 --- a/app/blueprints/packages/reviews.py +++ b/app/blueprints/packages/reviews.py @@ -75,7 +75,7 @@ def review(package): # Validate and submit elif can_review and form.validate_on_submit(): if has_blocked_domains(form.comment.data, current_user.username, f"review of {package.getId()}"): - flash(gettext("Linking to malicious sites is not allowed."), "danger") + flash(gettext("Linking to blocked sites is not allowed"), "danger") else: was_new = False if not review: diff --git a/app/blueprints/threads/__init__.py b/app/blueprints/threads/__init__.py index 4b1a7b9d..d208f6b0 100644 --- a/app/blueprints/threads/__init__.py +++ b/app/blueprints/threads/__init__.py @@ -200,7 +200,7 @@ def edit_reply(id): if form.validate_on_submit(): comment = form.comment.data if has_blocked_domains(comment, current_user.username, f"edit to reply {reply.get_url(True)}"): - flash(gettext("Linking to malicious sites is not allowed."), "danger") + flash(gettext("Linking to blocked sites is not allowed"), "danger") else: msg = "Edited reply by {}".format(reply.author.display_name) severity = AuditSeverity.NORMAL if current_user == reply.author else AuditSeverity.MODERATION @@ -233,7 +233,7 @@ def view(id): return redirect(thread.getViewURL()) if has_blocked_domains(comment, current_user.username, f"reply to {thread.getViewURL(True)}"): - flash(gettext("Linking to malicious sites is not allowed."), "danger") + flash(gettext("Linking to blocked sites is not allowed"), "danger") return render_template("threads/view.html", thread=thread, form=form) reply = ThreadReply() @@ -325,7 +325,7 @@ def new(): # Validate and submit elif form.validate_on_submit(): if has_blocked_domains(form.comment.data, current_user.username, f"new thread"): - flash(gettext("Linking to malicious sites is not allowed."), "danger") + flash(gettext("Linking to blocked sites is not allowed"), "danger") else: thread = Thread() thread.author = current_user diff --git a/app/blueprints/users/settings.py b/app/blueprints/users/settings.py index 05131b0e..98bf9f8b 100644 --- a/app/blueprints/users/settings.py +++ b/app/blueprints/users/settings.py @@ -82,7 +82,7 @@ def handle_profile_edit(form: UserProfileForm, user: User, username: str): if user.checkPerm(current_user, Permission.CHANGE_PROFILE_URLS): if has_blocked_domains(form.website_url.data, current_user.username, f"{user.username}'s website_url") or \ has_blocked_domains(form.donate_url.data, current_user.username, f"{user.username}'s donate_url"): - flash(gettext("Linking to malicious sites is not allowed."), "danger") + flash(gettext("Linking to blocked sites is not allowed"), "danger") return user.website_url = form.website_url.data diff --git a/app/logic/packages.py b/app/logic/packages.py index 11203d8a..34da108b 100644 --- a/app/logic/packages.py +++ b/app/logic/packages.py @@ -121,7 +121,7 @@ def do_edit_package(user: User, package: Package, was_new: bool, was_web: bool, for field in ["short_desc", "desc", "website", "issueTracker", "repo", "video_url"]: if field in data and has_blocked_domains(data[field], user.username, f"{field} of {package.getId()}"): - raise LogicError(403, lazy_gettext("Linking to malicious sites is not allowed.")) + raise LogicError(403, lazy_gettext("Linking to blocked sites is not allowed")) if "type" in data: data["type"] = PackageType.coerce(data["type"]) diff --git a/app/utils/__init__.py b/app/utils/__init__.py index 3c73fa69..7469c0bf 100644 --- a/app/utils/__init__.py +++ b/app/utils/__init__.py @@ -63,7 +63,7 @@ def has_blocked_domains(text: str, username: str, location: str) -> bool: if domain in text: from app.tasks.webhooktasks import post_discord_webhook post_discord_webhook.delay(username, - f"Attempted to post link to blocked domain {domain} in {location}", + f"Attempted to post blocked domain {domain} in {location}", True) return True