mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-09 17:13:45 +01:00
Improve bot message friendliness
This commit is contained in:
parent
cef8985d38
commit
3b140df508
@ -154,7 +154,8 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
||||
except MinetestCheckError as err:
|
||||
db.session.rollback()
|
||||
|
||||
msg = f"{err}\n\nTask ID: {self.request.id}\n\nRelease: [View Release]({release.getEditURL()})"
|
||||
task_url = url_for('tasks.check', id=self.request.id)
|
||||
msg = f"{err}\n\n[View Release]({release.getEditURL()}) | [View Task]({task_url})"
|
||||
post_bot_message(release.package, f"Release {release.title} validation failed", msg)
|
||||
|
||||
if "Fails validation" not in release.title:
|
||||
@ -347,8 +348,8 @@ def check_update_config(self, package_id):
|
||||
.replace("Cloning into '/tmp/", "Cloning into '") \
|
||||
.strip()
|
||||
|
||||
msg = "Error: {}.\n\nTask ID: {}\n\n[Change update configuration]({})" \
|
||||
.format(err, self.request.id, package.getURL("packages.update_config"))
|
||||
msg = "Error: {}.\n\n[Change update configuration]({}) | [View task]({})" \
|
||||
.format(err, package.getURL("packages.update_config"), url_for("tasks.check", id=self.request.id))
|
||||
|
||||
post_bot_message(package, "Failed to check git repository", msg)
|
||||
|
||||
|
@ -118,7 +118,7 @@ def post_bot_message(package: Package, title: str, message: str):
|
||||
if not thread:
|
||||
thread = Thread()
|
||||
thread.package = package
|
||||
thread.title = "Bot messages for {}".format(package.title)
|
||||
thread.title = "Messages for '{}'".format(package.title)
|
||||
thread.author = system_user
|
||||
thread.private = True
|
||||
thread.watchers.extend(package.maintainers)
|
||||
@ -128,7 +128,7 @@ def post_bot_message(package: Package, title: str, message: str):
|
||||
reply = ThreadReply()
|
||||
reply.thread = thread
|
||||
reply.author = system_user
|
||||
reply.comment = "**{}**\n\n{}".format(title, message)
|
||||
reply.comment = "**{}**\n\n{}\n\nThis is an automated message, but you can reply if you need help".format(title, message)
|
||||
db.session.add(reply)
|
||||
|
||||
addNotification(thread.watchers, system_user, NotificationType.BOT,
|
||||
|
Loading…
Reference in New Issue
Block a user