You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It has also been discovered that the history entries as they are saved to the database, are being saved as a json string. This is not desirable. Whilst this is not a war stopper and it has enabled the current UI to function, the new UI and API will not be modified to cater for this mishap.
Implementing a fix for the DB format error will break the current interface as far as viewing history is concerned. Whilst currently the new UI can view the history (once the above query is fixed), it's not correctly formatted within the interface, which lowers the UX.
Moving forward the query related fix for the UI will be implemented with the correction to the storage format being corrected when the new UI becomes more stable.
``` diff
diff --git a/app/core/mixin/history_save.py b/app/core/mixin/history_save.py
index e0574d7d..413e62fc 100644
--- a/app/core/mixin/history_save.py
+++ b/app/core/mixin/history_save.py
@@ -67,7 +67,7 @@ class SaveHistory(models.Model):
if entry not in remove_keys:
clean[entry] = value
- before_json = json.dumps(clean)
+ before_json = clean
clean = {}
for entry in after:
@@ -107,7 +107,7 @@ class SaveHistory(models.Model):
clean[entry] = value
- after_json = json.dumps(clean)
+ after_json = clean
item_parent_pk = None
item_parent_class = None
```
- [ ] Create Migration to correct storage format of before and after fields
The text was updated successfully, but these errors were encountered:
jon-nfc
changed the title
Fix the DB storage format ⚠️ see notes above
will need a migration to correct the previous entries
diff --git a/app/core/mixin/history_save.py b/app/core/mixin/history_save.py
index e0574d7d..413e62fc 100644
--- a/app/core/mixin/history_save.py
+++ b/app/core/mixin/history_save.py
@@ -67,7 +67,7 @@ class SaveHistory(models.Model):
if entry not in remove_keys:
clean[entry] = value
- before_json = json.dumps(clean)
+ before_json = clean
clean = {}
for entry in after:
@@ -107,7 +107,7 @@ class SaveHistory(models.Model):
clean[entry] = value
- after_json = json.dumps(clean)
+ after_json = clean
item_parent_pk = None
item_parent_class = None
Fix the DB storage format
Jan 24, 2025
fix the storage format of history entries.
Details
It has also been discovered that the history entries as they are saved to the database, are being saved as a json string. This is not desirable. Whilst this is not a war stopper and it has enabled the current UI to function, the new UI and API will not be modified to cater for this mishap.
Implementing a fix for the DB format error will break the current interface as far as viewing history is concerned. Whilst currently the new UI can view the history (once the above query is fixed), it's not correctly formatted within the interface, which lowers the UX.
Moving forward the query related fix for the UI will be implemented with the correction to the storage format being corrected when the new UI becomes more stable.
The text was updated successfully, but these errors were encountered: