Use separate slack channel for inventory messages

This commit is contained in:
2023-11-14 05:45:17 +02:00
parent a4b92f8008
commit 24bc46e098
4 changed files with 17 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ from oidc import page_oidc, login_required, read_user, do_login
page_inventory = Blueprint("inventory", __name__)
db = MongoClient(const.MONGO_URI).get_default_database()
channel = "inventory"
@page_inventory.route("/m/inventory/<item_id>/view")
def view_inventory_view(item_id):
@@ -457,7 +458,7 @@ def view_inventory_use(item_id):
msg = "%s has started using %s" % (user["name"], item_name)
if item.get("shortener") and item["shortener"].get("slug"):
msg += ("\nk6.ee/%s" % item["shortener"]["slug"])
spam(msg)
spam(msg, channel)
return redirect("/m/inventory/%s/view" % item_id)
@@ -484,5 +485,5 @@ def view_inventory_vacate(item_id):
msg = "%s has stopped using %s" % (user["name"], item_name)
if item.get("shortener") and item["shortener"].get("slug"):
msg += ("\nk6.ee/%s" % item["shortener"]["slug"])
spam(msg)
spam(msg, channel)
return redirect("/m/inventory/%s/view" % item_id)