-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtriggers.py
28 lines (25 loc) · 1.02 KB
/
triggers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from apps.workspaces.models import WorkspaceSchedule
from apps.workspaces.tasks import schedule_sync
from apps.workspaces.tasks import post_to_integration_settings
class AdvancedConfigurationsTriggers:
"""
Class containing all triggers for advanced_configurations
"""
@staticmethod
def run_post_configurations_triggers(workspace_id: int, workspace_schedule: WorkspaceSchedule) -> None:
"""
Run workspace general settings triggers
"""
schedule_sync(
workspace_id=workspace_id,
schedule_enabled=workspace_schedule.get('enabled'),
hours=workspace_schedule.get('interval_hours'),
email_added=workspace_schedule.get('additional_email_options'),
emails_selected=workspace_schedule.get('emails_selected')
)
@staticmethod
def post_to_integration_settings(workspace_id: int, active: bool) -> None:
"""
Post to integration settings
"""
post_to_integration_settings(workspace_id, active)