diff --git a/primed/users/audit.py b/primed/users/audit.py index 201c9c50..1d8e27a9 100644 --- a/primed/users/audit.py +++ b/primed/users/audit.py @@ -243,8 +243,10 @@ def audit_drupal_users(study_sites, json_api, apply_changes=False): if sa: user_sites_changed = drupal_adapter.update_user_study_sites( user=sa.user, - extra_data={"study_site_or_center": drupal_user_study_site_shortnames}, - apply_update=apply_changes + extra_data={ + "study_site_or_center": drupal_user_study_site_shortnames + }, + apply_update=apply_changes, ) if user_changed or user_sites_changed and not is_new_user: audit_results.add_update(data=user) diff --git a/primed/users/management/commands/sync-drupal-data.py b/primed/users/management/commands/sync-drupal-data.py index 4af3a6b4..8d97930e 100644 --- a/primed/users/management/commands/sync-drupal-data.py +++ b/primed/users/management/commands/sync-drupal-data.py @@ -26,7 +26,7 @@ def handle(self, *args, **options): should_update = options.get("update") user_audit_results = drupal_data_user_audit(apply_changes=should_update) - print(f"User Audit Results {user_audit_results}") + print(f"User Audit (Update: {should_update}) Results {user_audit_results}") if user_audit_results.encountered_issues(): print( user_audit_results.rows_by_result_type( @@ -35,7 +35,7 @@ def handle(self, *args, **options): ) site_audit_results = drupal_data_study_site_audit(apply_changes=should_update) - print(f"Site Audit Results {site_audit_results}") + print(f"Site Audit (Update: {should_update}) Results {site_audit_results}") if site_audit_results.encountered_issues(): print( site_audit_results.rows_by_result_type(