code: def find_and_fire_hook(event_name, instance, user_override=None):
      
      try:
          from django.contrib.auth import get_user_model
          User = get_user_model()
      except ImportError:
          from django.contrib.auth.models import User
      from rest_hooks.models import HOOK_EVENTS
  
      if not event_name in HOOK_EVENTS.keys():
          raise Exception(
              '"{}" does not exist in `settings.HOOK_EVENTS`.'.format(event_name)
          )
  
      filters = {'event': event_name}
  
      # Ignore the user if the user_override is False
      if user_override is not False:
          if user_override:
              filters['user'] = user_override
          elif hasattr(instance, 'user'):
              filters['user'] = instance.user
          elif isinstance(instance, User):
              filters['user'] = instance
          else:
              raise Exception(
                  '{} has no `user` property. REST Hooks needs this.'.format(repr(instance))
              )
      # NOTE: This is probably up for discussion, but I think, in this
      # case, instead of raising an error, we should fire the hook for
      # all users/accounts it is subscribed to. That would be a genuine
      # usecase rather than erroring because no user is associated with
      # this event.
  
      HookModel = get_hook_model()
  
      hooks = HookModel.objects.filter(**filters)
      for hook in hooks:
          hook.deliver_hook(instance)
docs: Look up Hooks that apply