diff --git a/app/tasks/importtasks.py b/app/tasks/importtasks.py index d71eeccb..b05b7412 100644 --- a/app/tasks/importtasks.py +++ b/app/tasks/importtasks.py @@ -27,7 +27,7 @@ from kombu import uuid from app.models import * from app.tasks import celery, TaskError -from app.utils import randomString, getExtension, post_system_thread +from app.utils import randomString, getExtension, post_bot_message from .minetestcheck import build_tree, MinetestCheckError, ContentType @@ -329,7 +329,7 @@ def check_update_config(self, package_id): msg = "Error: {}.\n\nTask ID: {}\n\n[Change update configuration]({})" \ .format(err, self.request.id, package.getUpdateConfigURL()) - post_system_thread(package, "Failed to check git repository", msg) + post_bot_message(package, "Failed to check git repository", msg) db.session.commit() return @@ -363,7 +363,7 @@ def check_update_config(self, package_id): msg = "New commit {} was found on the Git repository.{}\n\n[Change update configuration]({})" \ .format(hash[0:5], msg_last, package.getUpdateConfigURL()) - post_system_thread(package, "New commit detected, package may be outdated", msg) + post_bot_message(package, "New commit detected, package may be outdated", msg) config.last_commit = hash db.session.commit() diff --git a/app/utils.py b/app/utils.py index 718be6d2..1d826ce0 100644 --- a/app/utils.py +++ b/app/utils.py @@ -255,7 +255,7 @@ def nonEmptyOrNone(str): return str -def post_system_thread(package: Package, title: str, message: str): +def post_bot_message(package: Package, title: str, message: str): system_user = User.query.filter_by(username="ContentDB").first() assert system_user @@ -263,7 +263,7 @@ def post_system_thread(package: Package, title: str, message: str): if not thread: thread = Thread() thread.package = package - thread.title = "System Notifications" + thread.title = "Bot messages for {}".format(package.title) thread.author = system_user thread.private = True thread.watchers.append(package.author)