Use display name rather than username in Discord webhooks
This commit is contained in:
@@ -412,7 +412,7 @@ def move_to_state(package):
|
|||||||
|
|
||||||
if state == PackageState.APPROVED:
|
if state == PackageState.APPROVED:
|
||||||
if not package.approved_at:
|
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,
|
"New package {}".format(package.get_url("packages.view", absolute=True)), False,
|
||||||
package.title, package.short_desc, package.get_thumb_url(2, True))
|
package.title, package.short_desc, package.get_thumb_url(2, True))
|
||||||
package.approved_at = datetime.datetime.now()
|
package.approved_at = datetime.datetime.now()
|
||||||
@@ -423,7 +423,7 @@ def move_to_state(package):
|
|||||||
|
|
||||||
msg = "Approved {}".format(package.title)
|
msg = "Approved {}".format(package.title)
|
||||||
elif state == PackageState.READY_FOR_REVIEW:
|
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,
|
"Ready for Review: {}".format(package.get_url("packages.view", absolute=True)), True,
|
||||||
package.title, package.short_desc, package.get_thumb_url(2, 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)
|
url_for("threads.view", id=thread.id), package)
|
||||||
|
|
||||||
if was_new:
|
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)
|
"Reviewed {}: {}".format(package.title, thread.get_view_url(absolute=True)), False)
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user