handlers.global_application_handler

class GlobalApplicationHandler(handlers.eventhandler.EventHandler):

Whenever somebody updates an Application, we check if it's a "Global"-tagged application. If this is the case, we link all "Global"-tagged organizations to that application.

Configuration:
fact_sheet_type: The fact sheet type to be linked, e.g. Organization or UserGroup.
application_type_tag_group: Tag group of the triggering tag
application_tag_name: Name of the triggering tag
organization_type_tag_group: Tag group of the organization tag
organization_tag_name: Tag name of the organization tag

name = 'Global Applications Auto-Linking'
description = 'Links global-tagged Applications to all global-tagged Organizations.'
conditions = {'event_types': ['FactSheetUpdatedEvent'], 'fs_types': ['Application']}
supports_initial_sync = True
config_template = {'fact_sheet_type': 'Organization', 'application_type_tag_group': 'Application Type', 'application_tag_name': 'Global', 'organization_type_tag_group': 'Organization Type', 'organization_tag_name': 'Global'}
def handle(self, event, application, **kwargs):

Called automatically whenever a FactSheetUpdated event comes in via webhook.