Compare commits
1 Commits
5ea2cdfc9e
...
54feb9686c
| Author | SHA1 | Date | |
|---|---|---|---|
| 54feb9686c |
@@ -2,6 +2,26 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def _load_all_models() -> None:
|
||||||
|
"""Import every model module so SQLAlchemy's declarative registry
|
||||||
|
resolves cross-table relationships (e.g. User.role, User.agent).
|
||||||
|
|
||||||
|
main.py's startup() does the same thing for the web server; the CLI
|
||||||
|
skips startup() but still queries User → would otherwise hit
|
||||||
|
`KeyError: 'Agent'` when SA tries to resolve relationship targets.
|
||||||
|
Keep this list in sync with main.py's startup import list.
|
||||||
|
"""
|
||||||
|
from app.models import ( # noqa: F401
|
||||||
|
models, webhook, apikey, activity, milestone, notification, worklog,
|
||||||
|
monitor, role_permission, task, support, meeting, proposal, propose,
|
||||||
|
essential, agent, calendar, minimum_workload, schedule_type,
|
||||||
|
schedule_type_special_slot, oidc_settings,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
_load_all_models()
|
||||||
|
|
||||||
|
|
||||||
USAGE = """Usage:
|
USAGE = """Usage:
|
||||||
hf-cli admin create-user --email <e> [--username <u>] [--full-name <n>]
|
hf-cli admin create-user --email <e> [--username <u>] [--full-name <n>]
|
||||||
[--password <p>] [--oidc-issuer <url> --oidc-subject <sub>]
|
[--password <p>] [--oidc-issuer <url> --oidc-subject <sub>]
|
||||||
|
|||||||
Reference in New Issue
Block a user