diff --git a/apps/mappings/signals.py b/apps/mappings/signals.py index 58b45385..220049f8 100644 --- a/apps/mappings/signals.py +++ b/apps/mappings/signals.py @@ -14,9 +14,17 @@ from apps.workspaces.models import Configuration from apps.workspaces.tasks import delete_cards_mapping_settings -from .models import GeneralMapping +from .models import GeneralMapping, SubsidiaryMapping from .tasks import schedule_auto_map_ccc_employees + +@receiver(post_save, sender=SubsidiaryMapping) +def run_post_subsidiary_mappings(sender, instance: SubsidiaryMapping, **kwargs): + + workspace = instance.workspace + workspace.onboarding_state = 'MAP_EMPLOYEES' + workspace.save() + @receiver(post_save, sender=MappingSetting) def run_post_mapping_settings_triggers(sender, instance: MappingSetting, **kwargs): """ diff --git a/apps/workspaces/views.py b/apps/workspaces/views.py index af40dab8..dc67116b 100644 --- a/apps/workspaces/views.py +++ b/apps/workspaces/views.py @@ -175,6 +175,7 @@ def post(self, request, **kwargs): workspace=workspace ) workspace.ns_account_id = ns_account_id + workspace.onboarding_state = 'SUBSIDIARY' workspace.save() else: