Files
devplacepy/devplacepy/database/enter_submit.py
T
retoor 8a48e3ef85
DevPlace CI / test (push) Failing after 3h10m39s
Keep composers usable, group actions and notifications, and drop the tool-count cap
Comment and post layouts stay full width on small screens. Secondary actions live in the More menu. Notifications can be grouped and throttled, and Enter can submit when that profile setting is on. Emulated-tool models accept large catalogs, with reserved names aliased on the wire and the catalog cached per owner. A dropped service-worker navigation is retried once. The test server waits 120s to finish importing before it is stopped.
2026-11-12 15:29:27 +01:00

23 lines
602 B
Python

# retoor <retoor@molodetz.nl>
from .core import db, get_table
def get_enter_to_submit(owner_id: str) -> bool:
if "users" not in db.tables:
return True
user = db["users"].find_one(uid=owner_id)
if user is None:
return True
value = user.get("enter_to_submit")
return True if value is None else bool(value)
def set_enter_to_submit(owner_id: str, enabled: bool) -> None:
from devplacepy.utils import clear_user_cache
get_table("users").update(
{"uid": owner_id, "enter_to_submit": 1 if enabled else 0}, ["uid"]
)
clear_user_cache(owner_id)