Skip to content

Batch Edit Validation Improvements #7024

Description

@bronwyncombs

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

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,

if isinstance(field, DateTimeField) and isinstance(val, str):
branch is irrelevant to us (trace out why)

Also linked in the relevant PR:
4814f11

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions