Jul 16 - Fill the gaps between Single-tenant mode and Multi-tenant mode - MT2

This commit is contained in:
2026-07-16 16:59:17 -04:00
parent 8ff38578ad
commit a60afc6c41
10 changed files with 478 additions and 44 deletions
+3 -8
View File
@@ -1008,15 +1008,10 @@ def delete(issue_id):
db.session.delete(issue)
db.session.commit()
# Remove orphaned photo files — best-effort, never block on failure
static_folder = current_app.root_path
# Remove orphaned photo files from the active storage backend — best-effort.
from app.utils import storage
for rel_path in photo_paths:
abs_path = os.path.normpath(os.path.join(static_folder, 'static', rel_path))
try:
if os.path.isfile(abs_path):
os.remove(abs_path)
except OSError:
pass
storage.delete(rel_path)
current_app.logger.info(
'ISSUE DELETED | id=%s | severity=%s | area=%s | facility=%s | deleted_by=%s',