File tree 1 file changed +11
-2
lines changed
dss-plugin-visual-edit/python-lib
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -461,13 +461,22 @@ def update_row(
461
461
"""
462
462
key = get_key_values_from_dict (primary_keys , self .primary_keys )
463
463
464
+ def is_reviewed_column (column_name : str ):
465
+ return column_name == "Reviewed" or column_name == "reviewed"
466
+
467
+ def is_comments_column (column_name : str ):
468
+ return column_name == "Comments" or column_name == "comments"
469
+
464
470
# for reviewed column, create an editlog for each columns to enforce values even after a change in the original.
465
- if column == "Reviewed" or column == "reviewed" :
471
+ # Append the reviewed value change last in case something goes wrong during updates of the previous column values.
472
+ # To improve this, the best would be to do all the inserts in the same transaction.
473
+ if is_reviewed_column (column ):
466
474
results = []
467
475
for col in self .editable_column_names :
468
- if col != "Comments" and col != "comments" :
476
+ if not is_comments_column ( col ) and not is_reviewed_column ( col ) :
469
477
# contains values for primary keys — and other columns too, but they'll be discarded
470
478
results .append (self .__log_edit__ (key , col , primary_keys [col ]))
479
+ results .append (self .__log_edit__ (key , column , primary_keys [column ]))
471
480
return results
472
481
else :
473
482
return [self .__log_edit__ (key , column , value , action = "update" )]
You can’t perform that action at this time.
0 commit comments