mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Change bot thread title
This commit is contained in:
parent
c5d99e00d8
commit
ee9f6454e0
@ -27,7 +27,7 @@ from kombu import uuid
|
|||||||
|
|
||||||
from app.models import *
|
from app.models import *
|
||||||
from app.tasks import celery, TaskError
|
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
|
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]({})" \
|
msg = "Error: {}.\n\nTask ID: {}\n\n[Change update configuration]({})" \
|
||||||
.format(err, self.request.id, package.getUpdateConfigURL())
|
.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()
|
db.session.commit()
|
||||||
return
|
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]({})" \
|
msg = "New commit {} was found on the Git repository.{}\n\n[Change update configuration]({})" \
|
||||||
.format(hash[0:5], msg_last, package.getUpdateConfigURL())
|
.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
|
config.last_commit = hash
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
@ -255,7 +255,7 @@ def nonEmptyOrNone(str):
|
|||||||
return 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()
|
system_user = User.query.filter_by(username="ContentDB").first()
|
||||||
assert system_user
|
assert system_user
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ def post_system_thread(package: Package, title: str, message: str):
|
|||||||
if not thread:
|
if not thread:
|
||||||
thread = Thread()
|
thread = Thread()
|
||||||
thread.package = package
|
thread.package = package
|
||||||
thread.title = "System Notifications"
|
thread.title = "Bot messages for {}".format(package.title)
|
||||||
thread.author = system_user
|
thread.author = system_user
|
||||||
thread.private = True
|
thread.private = True
|
||||||
thread.watchers.append(package.author)
|
thread.watchers.append(package.author)
|
||||||
|
Loading…
Reference in New Issue
Block a user