Skip to content

Commit

Permalink
State change on connection and subsidiary update (#428)
Browse files Browse the repository at this point in the history
* onboarding state implementation

* tests migrations

* added onboarding state

* changed comment

* added subsidiary state to onboarding state

* changed script to add subsidiary state and fixed some bug

* bug fix

* state change on connection and subsidiary change

---------

Co-authored-by: Ashutosh619-sudo <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
  • Loading branch information
3 people authored Oct 17, 2023
1 parent 7b6acce commit 917c67c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/mappings/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
1 change: 1 addition & 0 deletions apps/workspaces/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 917c67c

Please sign in to comment.