From 18ee0108e5ad48f53506bced5e2b26a379d4157a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 22 Jul 2023 12:45:50 +0100 Subject: [PATCH] Use display name rather than username in Discord webhooks --- app/blueprints/packages/packages.py | 4 ++-- app/blueprints/packages/reviews.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index 7987051c..c5342dc1 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -412,7 +412,7 @@ def move_to_state(package): if state == PackageState.APPROVED: if not package.approved_at: - post_discord_webhook.delay(package.author.username, + post_discord_webhook.delay(package.author.display_name, "New package {}".format(package.get_url("packages.view", absolute=True)), False, package.title, package.short_desc, package.get_thumb_url(2, True)) package.approved_at = datetime.datetime.now() @@ -423,7 +423,7 @@ def move_to_state(package): msg = "Approved {}".format(package.title) elif state == PackageState.READY_FOR_REVIEW: - post_discord_webhook.delay(package.author.username, + post_discord_webhook.delay(package.author.display_name, "Ready for Review: {}".format(package.get_url("packages.view", absolute=True)), True, package.title, package.short_desc, package.get_thumb_url(2, True)) diff --git a/app/blueprints/packages/reviews.py b/app/blueprints/packages/reviews.py index 43ccf684..24983dd5 100644 --- a/app/blueprints/packages/reviews.py +++ b/app/blueprints/packages/reviews.py @@ -127,7 +127,7 @@ def review(package): url_for("threads.view", id=thread.id), package) if was_new: - post_discord_webhook.delay(thread.author.username, + post_discord_webhook.delay(thread.author.display_name, "Reviewed {}: {}".format(package.title, thread.get_view_url(absolute=True)), False) db.session.commit()