Skip to content

Commit

Permalink
deleting mapping-settings if import-customer toggle is disabled (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
labhvam5 authored Nov 15, 2022
1 parent 96007b4 commit 33bef81
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/workspaces/apis/import_settings/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ def post_save_workspace_general_settings(self):
import_categories=self.__workspace_general_settings.get('import_categories'),
workspace_id=self.__workspace_id
)


if not self.__workspace_general_settings.get('import_customers'):
MappingSetting.objects.filter(
workspace_id=self.__workspace_id,
source_field='PROJECT',
destination_field='CUSTOMER'
).delete()
schedule_projects_creation(False, self.__workspace_id)

def pre_save_mapping_settings(self):
"""
Post save action for mapping settings
Expand Down

0 comments on commit 33bef81

Please sign in to comment.