diff --git a/apps/workspaces/serializers.py b/apps/workspaces/serializers.py index 53448fa..492f495 100644 --- a/apps/workspaces/serializers.py +++ b/apps/workspaces/serializers.py @@ -215,7 +215,9 @@ def update(self, instance, validated): mapping_settings = validated.pop('mapping_settings') import_settings = validated.pop('import_settings') - if import_settings.get('charts_of_accounts') != instance.import_settings.charts_of_accounts: + import_setting_instance = ImportSetting.objects.filter(workspace_id=instance.id).first() + + if import_setting_instance and import_settings.get('charts_of_accounts') != instance.import_settings.charts_of_accounts: category_import_log = ImportLog.objects.filter(workspace_id=instance.id, attribute_type='CATEGORY').first() if category_import_log: