06/09 Update a customer AI chatbot and support form submision
This commit is contained in:
+9
-1
@@ -116,13 +116,19 @@ def create_app(config_name='default'):
|
||||
pv_count = Issue.query.filter_by(
|
||||
status='pending_verification'
|
||||
).count()
|
||||
# Open support tickets — admin/director only
|
||||
open_support = 0
|
||||
if current_user.role in ('admin', 'director'):
|
||||
from app.models.support import SupportTicket
|
||||
open_support = SupportTicket.query.filter_by(status='open').count()
|
||||
return {
|
||||
'unread_notification_count': unread,
|
||||
'pending_verification_count': pv_count,
|
||||
'open_support_tickets_count': open_support,
|
||||
}
|
||||
except Exception:
|
||||
pass
|
||||
return {'unread_notification_count': 0, 'pending_verification_count': 0}
|
||||
return {'unread_notification_count': 0, 'pending_verification_count': 0, 'open_support_tickets_count': 0}
|
||||
|
||||
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
|
||||
|
||||
@@ -133,6 +139,7 @@ def create_app(config_name='default'):
|
||||
from app.routes import projects # Phase 1/2 — Project management
|
||||
from app.routes import customers # Phase 5 — Customer management
|
||||
from app.routes import scheduled_reports # Phase 6 — Scheduled reports
|
||||
from app.routes import support # Support chat + admin tickets
|
||||
|
||||
app.register_blueprint(auth.bp)
|
||||
app.register_blueprint(dashboard.bp)
|
||||
@@ -146,6 +153,7 @@ def create_app(config_name='default'):
|
||||
app.register_blueprint(projects.bp)
|
||||
app.register_blueprint(customers.bp)
|
||||
app.register_blueprint(scheduled_reports.bp)
|
||||
app.register_blueprint(support.bp)
|
||||
|
||||
# ── Mobile API (Phase 7 / Phase A / Phase B / Phase C) ───────────────────
|
||||
# The /api/v1 blueprint group uses JWT Bearer tokens — no CSRF cookies needed.
|
||||
|
||||
Reference in New Issue
Block a user