diff --git a/source/app/alembic/versions/9e4947a207a6_add_modification_history_to_case_objects.py b/source/app/alembic/versions/9e4947a207a6_add_modification_history_to_case_objects.py index 29eb71a07..0da1d7cfa 100644 --- a/source/app/alembic/versions/9e4947a207a6_add_modification_history_to_case_objects.py +++ b/source/app/alembic/versions/9e4947a207a6_add_modification_history_to_case_objects.py @@ -21,18 +21,26 @@ def upgrade(): tables = ['ioc', 'case_assets', 'case_received_file', 'case_tasks', 'notes', 'cases_events'] for table in tables: if not _table_has_column(table, 'modification_history'): - op.add_column(table, - sa.Column('modification_history', sa.JSON) - ) - t_ua = sa.Table( - table, - sa.MetaData(), - sa.Column('modification_history', sa.JSON) - ) - conn = op.get_bind() - conn.execute(t_ua.update().values( - modification_history={} - )) + try: + op.add_column(table, + sa.Column('modification_history', sa.JSON) + ) + t_ua = sa.Table( + table, + sa.MetaData(), + sa.Column('modification_history', sa.JSON) + ) + conn = op.get_bind() + conn.execute(t_ua.update().values( + modification_history={} + )) + + # Commit the transaction + conn.commit() + + except Exception as e: + print(f"Error adding column to {table}: {e}") + continue pass diff --git a/source/app/static/assets/js/iris/case.tasks.js b/source/app/static/assets/js/iris/case.tasks.js index a20dcfc99..6386240d9 100644 --- a/source/app/static/assets/js/iris/case.tasks.js +++ b/source/app/static/assets/js/iris/case.tasks.js @@ -409,7 +409,7 @@ $(document).ready(function(){ "data": "task_open_date", "render": function (data, type, row, meta) { if (type === 'display' && data != null) { - return render_date(data); + return formatTime(data); } return data; } diff --git a/source/app/static/assets/js/iris/case.timeline.js b/source/app/static/assets/js/iris/case.timeline.js index 77c7136dc..f1a9d0e27 100644 --- a/source/app/static/assets/js/iris/case.timeline.js +++ b/source/app/static/assets/js/iris/case.timeline.js @@ -726,7 +726,7 @@ function buildEvent(event_data, compact, comments_map, tree, tesk, tmb, idx, rea @@ -791,7 +791,7 @@ function buildEvent(event_data, compact, comments_map, tree, tesk, tmb, idx, rea
- ${formatTime(evt.event_date)}${ori_date} + ${formatTime(evt.event_date, { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit'})}${ori_date}
diff --git a/source/app/static/assets/js/iris/common.js b/source/app/static/assets/js/iris/common.js index 51ac83a74..2e5152e1f 100644 --- a/source/app/static/assets/js/iris/common.js +++ b/source/app/static/assets/js/iris/common.js @@ -655,7 +655,7 @@ function load_case_activity(){ } entry = `
  • - + ${sanitizeHTML(js_data[index].name)} - ${sanitizeHTML(js_data[index].activity_desc)}
  • ` $('#case_activities').append(entry); diff --git a/source/app/static/assets/js/iris/overview.js b/source/app/static/assets/js/iris/overview.js index 1b2a58840..e74b911a3 100644 --- a/source/app/static/assets/js/iris/overview.js +++ b/source/app/static/assets/js/iris/overview.js @@ -192,7 +192,7 @@ let OverviewTable = $("#overview_table").DataTable({ "data": "open_date", "render": function (data, type, row, meta) { if (type === 'display' && data != null) { - data = sanitizeHTML(data); + data = formatTime(data, { day: '2-digit', month: '2-digit', year: 'numeric' }); } return data; }