Use display name rather than username in Discord webhooks

This commit is contained in:
rubenwardy 2023-07-22 12:45:50 +01:00
parent d374ce27cf
commit 18ee0108e5
2 changed files with 3 additions and 3 deletions

@ -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))

@ -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()