privacy policy and business integration
This commit is contained in:
parent
141ca9fda3
commit
cd3751219d
16 changed files with 1592 additions and 30 deletions
17
backend/app/platform_settings.py
Normal file
17
backend/app/platform_settings.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from sqlalchemy.orm import Session
|
||||
|
||||
from .models import PlatformSetting
|
||||
|
||||
|
||||
def get_setting(db: Session, key: str, default: str = "") -> str:
|
||||
row = db.get(PlatformSetting, key)
|
||||
return row.value if row and row.value else default
|
||||
|
||||
|
||||
def set_setting(db: Session, key: str, value: str) -> None:
|
||||
row = db.get(PlatformSetting, key)
|
||||
if row:
|
||||
row.value = value
|
||||
else:
|
||||
db.add(PlatformSetting(key=key, value=value))
|
||||
db.commit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue