From 92759a5671c091e17a02832f3bd6a97d590ffdf1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 20:28:41 +1000 Subject: [PATCH] fix(backend): record export is empty when include permissions flag is used (#9704) (#9719) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 22ba802d698770ab4436cd4844fa9920c2ad7c2d) Co-authored-by: Gustaf Järgren --- tasks.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks.py b/tasks.py index 5ed434d998..2def7d3665 100644 --- a/tasks.py +++ b/tasks.py @@ -713,22 +713,22 @@ def export_records( data_out = [] - if include_permissions is False: - for entry in data: - model_name = entry.get('model', None) + for entry in data: + model_name = entry.get('model', None) - # Ignore any temporary settings (start with underscore) - if model_name in ['common.inventreesetting', 'common.inventreeusersetting']: - if entry['fields'].get('key', '').startswith('_'): - continue + # Ignore any temporary settings (start with underscore) + if model_name in ['common.inventreesetting', 'common.inventreeusersetting']: + if entry['fields'].get('key', '').startswith('_'): + continue + if include_permissions is False: if model_name == 'auth.group': entry['fields']['permissions'] = [] if model_name == 'auth.user': entry['fields']['user_permissions'] = [] - data_out.append(entry) + data_out.append(entry) # Write the processed data to file with open(target, 'w', encoding='utf-8') as f_out: