-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Is your feature request related to a problem? Please describe.
From Paul Bucci via discourse comment
Hi folks, love the batch edit feature! One nit, it looks like it’s currently a hard requirement to validate after a batch edit before committing. Once the errors are fixed, it requires a full re-validation before upload, which means that it’s double-checking already-validated fields as well as the newly fixed errors. On the other hand, the workbench allows uploads without re-validation.
Describe the solution you'd like
My suggestions are:
Re-validation should only be applied to edited fields (saves a lot of processing time)
Workbench and batch edit should operate in the same way to unify user experience
Many thanks! Already a helpful feature 🙂
—Paul
Reported By
University of British Columbia
Additional context
From Vinny via #5417 (comment)
we need a more nuanced way to compare old and new values.
Correct, but we already do (for API)! See
specify7/specifyweb/specify/api.py
Lines 536 to 544 in 1b2ab81
def fld_change_info(obj, field, val) -> Optional[FieldChangeInfo]: if field.name != 'timestampmodified': value = prepare_value(field, val) if isinstance(field, FloatField) or isinstance(field, DecimalField): value = None if value is None else float(value) old_value = getattr(obj, field.name) if str(old_value) != str(value): # ugh return FieldChangeInfo(field_name=field.name, old_value=old_value, new_value=value) return None Should just be a mechanical change to use it here. Also,
branch is irrelevant to us (trace out why)specify7/specifyweb/specify/api.py
Line 961 in 1b2ab81
if isinstance(field, DateTimeField) and isinstance(val, str):
Also linked in the relevant PR:
4814f11