Add audiolab and server-room

This commit is contained in:
Marta Sienkiewicz 2026-04-01 07:39:10 +02:00
parent 52c11f994e
commit a30f85931e

View file

@ -9,7 +9,13 @@ from dotenv import load_dotenv
DISCOURSE_URL = "https://kb.hs3.pl" # Database is hosted here DISCOURSE_URL = "https://kb.hs3.pl" # Database is hosted here
CATEGORY_ID = 9 # Database category ID CATEGORY_ID = 9 # Database category ID
PLACES = [
"cow-work",
"garage",
"lab",
"audiolab",
"server-room"
]
class DiscourseDatabase(): class DiscourseDatabase():
def __init__(self): def __init__(self):
data = self.get_category_data() data = self.get_category_data()
@ -69,8 +75,7 @@ class DiscourseDatabase():
def get_place(self, topic): def get_place(self, topic):
"""Get place of a topic""" """Get place of a topic"""
places = ["cow-work", "garage", "lab"] for place in PLACES:
for place in places:
if place in topic["tags"]: if place in topic["tags"]:
return f'<a href="https://kb.hs3.pl/tag/{place}">{place}</a>' return f'<a href="https://kb.hs3.pl/tag/{place}">{place}</a>'
return "unknown" return "unknown"