feat: topics 헬퍼 (get_topics, update_topics)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
th-kim0823
2026-04-27 19:48:34 +09:00
parent 70f326eb20
commit 6c6929a505
2 changed files with 32 additions and 0 deletions

11
app.py
View File

@@ -134,6 +134,17 @@ def can_accept_votes(data):
return s.get("current_stage") == "vote" and s.get("voting_open", False)
def get_topics():
return load_data().get("topics", {}).get("categories", [])
def update_topics(categories):
def _fn(data):
data.setdefault("topics", {})
data["topics"]["categories"] = categories
update_data(_fn)
def get_tie_breaks():
return load_data().get("tie_breaks", {})