Auto-commit local changes before build (2026-01-20 10:44:53)
This commit is contained in:
parent
e4e069a6b3
commit
899863a0de
@ -1 +1 @@
|
|||||||
v20260120-05-autotask-indent-fix
|
v20260120-06-routes-inbox-indent-fix
|
||||||
|
|||||||
@ -295,7 +295,7 @@ def inbox_message_approve(message_id: int):
|
|||||||
if hasattr(run, 'storage_free_percent') and hasattr(msg, 'storage_free_percent'):
|
if hasattr(run, 'storage_free_percent') and hasattr(msg, 'storage_free_percent'):
|
||||||
run.storage_free_percent = msg.storage_free_percent
|
run.storage_free_percent = msg.storage_free_percent
|
||||||
db.session.add(run)
|
db.session.add(run)
|
||||||
db.session.flush()
|
db.session.flush()
|
||||||
try:
|
try:
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
link_open_internal_tickets_to_run(run=run, job=job)
|
||||||
except Exception:
|
except Exception:
|
||||||
@ -529,6 +529,7 @@ def inbox_message_approve_vspc_companies(message_id: int):
|
|||||||
|
|
||||||
# De-duplicate: do not create multiple runs for the same (mail_message_id, job_id).
|
# De-duplicate: do not create multiple runs for the same (mail_message_id, job_id).
|
||||||
run = JobRun.query.filter(JobRun.job_id == job.id, JobRun.mail_message_id == msg.id).first()
|
run = JobRun.query.filter(JobRun.job_id == job.id, JobRun.mail_message_id == msg.id).first()
|
||||||
|
created = False
|
||||||
if run:
|
if run:
|
||||||
skipped_existing += 1
|
skipped_existing += 1
|
||||||
else:
|
else:
|
||||||
@ -541,24 +542,17 @@ def inbox_message_approve_vspc_companies(message_id: int):
|
|||||||
)
|
)
|
||||||
if hasattr(run, "remark"):
|
if hasattr(run, "remark"):
|
||||||
run.remark = getattr(msg, "overall_message", None)
|
run.remark = getattr(msg, "overall_message", None)
|
||||||
|
|
||||||
db.session.add(run)
|
db.session.add(run)
|
||||||
db.session.flush()
|
created = True
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
# Ensure we have IDs before linking tickets or persisting objects.
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
db.session.flush()
|
||||||
try:
|
try:
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
link_open_internal_tickets_to_run(run=run, job=job)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
db.session.flush()
|
|
||||||
try:
|
if created:
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
created_runs.append(run)
|
created_runs.append(run)
|
||||||
|
|
||||||
# Persist objects for reporting (idempotent upsert; safe to repeat).
|
# Persist objects for reporting (idempotent upsert; safe to repeat).
|
||||||
@ -704,22 +698,12 @@ def inbox_message_approve_vspc_companies(message_id: int):
|
|||||||
if hasattr(run2, "remark"):
|
if hasattr(run2, "remark"):
|
||||||
run2.remark = getattr(other, "overall_message", None)
|
run2.remark = getattr(other, "overall_message", None)
|
||||||
db.session.add(run2)
|
db.session.add(run2)
|
||||||
db.session.flush()
|
|
||||||
try:
|
db.session.flush()
|
||||||
link_open_internal_tickets_to_run(run=run2, job=job)
|
try:
|
||||||
except Exception:
|
link_open_internal_tickets_to_run(run=run2, job=job2)
|
||||||
|
except Exception:
|
||||||
pass
|
pass
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run2, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run2, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
|
|
||||||
# Persist objects per company
|
# Persist objects per company
|
||||||
try:
|
try:
|
||||||
@ -1085,22 +1069,12 @@ def inbox_reparse_all():
|
|||||||
run.storage_free_percent = msg.storage_free_percent
|
run.storage_free_percent = msg.storage_free_percent
|
||||||
|
|
||||||
db.session.add(run)
|
db.session.add(run)
|
||||||
db.session.flush()
|
|
||||||
try:
|
db.session.flush()
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
try:
|
||||||
except Exception:
|
link_open_internal_tickets_to_run(run=run, job=job)
|
||||||
pass
|
except Exception:
|
||||||
db.session.flush()
|
pass
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
auto_approved_runs.append((job.customer_id, job.id, run.id, msg.id))
|
auto_approved_runs.append((job.customer_id, job.id, run.id, msg.id))
|
||||||
created_any = True
|
created_any = True
|
||||||
|
|
||||||
@ -1160,22 +1134,11 @@ def inbox_reparse_all():
|
|||||||
run.storage_free_percent = msg.storage_free_percent
|
run.storage_free_percent = msg.storage_free_percent
|
||||||
|
|
||||||
db.session.add(run)
|
db.session.add(run)
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush() # ensure run.id is available
|
db.session.flush() # ensure run.id is available
|
||||||
|
try:
|
||||||
|
link_open_internal_tickets_to_run(run=run, job=job)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
auto_approved_runs.append((job.customer_id, job.id, run.id, msg.id))
|
auto_approved_runs.append((job.customer_id, job.id, run.id, msg.id))
|
||||||
|
|
||||||
msg.job_id = job.id
|
msg.job_id = job.id
|
||||||
@ -1274,22 +1237,11 @@ def inbox_reparse_all():
|
|||||||
run.storage_free_percent = msg.storage_free_percent
|
run.storage_free_percent = msg.storage_free_percent
|
||||||
|
|
||||||
db.session.add(run)
|
db.session.add(run)
|
||||||
db.session.flush()
|
db.session.flush()
|
||||||
try:
|
try:
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
link_open_internal_tickets_to_run(run=run, job=job)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
try:
|
|
||||||
link_open_internal_tickets_to_run(run=run, job=job)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
db.session.flush()
|
|
||||||
auto_approved_runs.append((job.customer_id, job.id, run.id, msg.id))
|
auto_approved_runs.append((job.customer_id, job.id, run.id, msg.id))
|
||||||
|
|
||||||
msg.job_id = job.id
|
msg.job_id = job.id
|
||||||
|
|||||||
@ -400,6 +400,14 @@ Changes:
|
|||||||
- Corrected the indentation of db.session.flush() to restore valid Python syntax.
|
- Corrected the indentation of db.session.flush() to restore valid Python syntax.
|
||||||
- No functional or logical changes were made.
|
- No functional or logical changes were made.
|
||||||
|
|
||||||
|
## v20260120-06-routes-inbox-indent-fix
|
||||||
|
|
||||||
|
### Changes:
|
||||||
|
- Fixed multiple indentation and syntax errors in routes_inbox.py.
|
||||||
|
- Corrected misaligned db.session.flush() calls to ensure proper transaction handling.
|
||||||
|
- Repaired indentation of link_open_internal_tickets_to_run logic to prevent runtime exceptions.
|
||||||
|
- Restored application startup stability by resolving Python IndentationError issues.
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
## v0.1.21
|
## v0.1.21
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user