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.
Task
Correct API DB history query
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
Create Migration to correct storage format of before and after fields
The text was updated successfully, but these errors were encountered:
On a fresh install, after adding a device, software and device type there is no create history for the model.
for sub models when they are added to the primary model, it does create a history entry.
After looking into this issue, the history is still being created the bug is that the query for the history items is incorrect.
centurion_erp/app/core/viewsets/history.py
Lines 48 to 51 in 75cf55f
The above is only querying for child models and not the actual model like this one.
centurion_erp/app/core/views/history.py
Lines 158 to 160 in 75cf55f
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.
Task
Correct API DB history query
Fix the DB storage format⚠️ see notes above
will need a migration to correct the previous entries
The text was updated successfully, but these errors were encountered: