mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
Post package removals to Discord webhook
This commit is contained in:
parent
43af3a8e75
commit
0ecf992f83
@ -478,6 +478,10 @@ def remove(package):
|
|||||||
add_audit_log(AuditSeverity.EDITOR, current_user, msg, url, package)
|
add_audit_log(AuditSeverity.EDITOR, current_user, msg, url, package)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
post_discord_webhook.delay(current_user.username,
|
||||||
|
f"Deleted package {package.author.username}/{package.name} with reason '{reason}'",
|
||||||
|
True, package.title, package.short_desc, package.get_thumb_url(2, True))
|
||||||
|
|
||||||
flash(gettext("Deleted package"), "success")
|
flash(gettext("Deleted package"), "success")
|
||||||
|
|
||||||
return redirect(url)
|
return redirect(url)
|
||||||
@ -494,6 +498,10 @@ def remove(package):
|
|||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
post_discord_webhook.delay(current_user.username,
|
||||||
|
"Unapproved package with reason {}\n\n{}".format(reason, package.get_url("packages.view", absolute=True)), True,
|
||||||
|
package.title, package.short_desc, package.get_thumb_url(2, True))
|
||||||
|
|
||||||
flash(gettext("Unapproved package"), "success")
|
flash(gettext("Unapproved package"), "success")
|
||||||
|
|
||||||
return redirect(package.get_url("packages.view"))
|
return redirect(package.get_url("packages.view"))
|
||||||
|
Loading…
Reference in New Issue
Block a user