-
Notifications
You must be signed in to change notification settings - Fork 31
[FIX] export_bg: Handle import_compat parameter correctly in background export #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,8 +39,18 @@ def _export_chunk_bg(self, data, export_id, export_format): | |||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]] | ||||||||||||||||||||||||||||||||
| field_labels = [f.get("label") or f.get("string") for f in params["fields"]] | ||||||||||||||||||||||||||||||||
| # Extract field names considering import_compat mode | ||||||||||||||||||||||||||||||||
| import_compat = params.get("import_compat", True) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # For field_names (data extraction), always use the technical field name | ||||||||||||||||||||||||||||||||
| # Only use 'value' as fallback when import_compat=True (for import compatibility) | ||||||||||||||||||||||||||||||||
| if import_compat: | ||||||||||||||||||||||||||||||||
| field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]] | ||||||||||||||||||||||||||||||||
| field_labels = field_names # Use field names as headers for import compatibility | ||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||
| # When not import_compat, use only 'name' or 'id' for field_names, not 'value' | ||||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
+51
|
||||||||||||||||||||||||||||||||
| # For field_names (data extraction), always use the technical field name | |
| # Only use 'value' as fallback when import_compat=True (for import compatibility) | |
| if import_compat: | |
| field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]] | |
| field_labels = field_names # Use field names as headers for import compatibility | |
| else: | |
| # When not import_compat, use only 'name' or 'id' for field_names, not 'value' | |
| # Modo import_compat: para field_names usar name -> value -> id, | |
| # y reutilizar esos mismos nombres como cabeceras para mantener compatibilidad de import. | |
| if import_compat: | |
| field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]] | |
| field_labels = field_names # Use field names as headers for import compatibility | |
| else: | |
| # Modo normal (no import_compat): para field_names usar name -> id | |
| # y para field_labels usar label -> string (etiquetas legibles para el usuario). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import_compatestá defaulteando aTrue. Si el front envíaimport_compatcomoundefined,JSON.stringifyomite la clave y acá se activaría el modo import-compatible por defecto (cambiando headers a técnicos y la extracción). Para evitar regresiones, sería más seguro defaultear aFalse(comportamiento “export normal”) o normalizar explícitamente el valor (p.ej.bool(params.get('import_compat'))con defaultFalse).