Upgrade allow adding image in ticket details page comment section

This commit is contained in:
2026-03-30 11:14:35 -04:00
parent 2beef382b7
commit bf29ccb287
13 changed files with 419 additions and 26 deletions
+13
View File
@@ -133,10 +133,23 @@ def create_app(config_name=None):
with app.app_context():
db.create_all()
_seed_admin(app)
_seed_settings()
return app
def _seed_settings():
"""Ensure all required system settings exist with safe defaults."""
from app.models import SystemSetting
defaults = [
('registration_enabled', 'true', 'Allow new users to self-register via /auth/register'),
]
for key, value, description in defaults:
if SystemSetting.get(key) is None:
SystemSetting.set(key, value, description)
db.session.commit()
def _seed_admin(app):
"""Create the default admin account if none exists."""
from app.models import User, UserRole