(self, initiated_by, source, action, diffs=None, skip_destructive=False, skip=False)
:param initiated_by: Username of initiating user
        :param source: Source of action
        :param action: Action being performed. See ``DataSourceActionLog.action`` for options.
        :param diffs: Migration diff dict
        :param skip_destructive: True if this action was not actually performed because the data source
                                 is marked with ``disable_destructive_rebuild``
        :param skip: If True the action will not be logged.
:param initiated_by: Username of initiating user
        :param source: Source of action
        :param action: Action being performed. See ``DataSourceActionLog.action`` for options.
        :param diffs: Migration diff dict
        :param skip_destructive: True if this action was not actually performed because the data source
                                 is marked with ``disable_destructive_rebuild``
        :param skip: If True the action will not be logged.
: param initiated_by : Username of initiating user : param source : Source of action : param action : Action being performed . See DataSourceActionLog . action for options . : param diffs : Migration diff dict : param skip_destructive : True if this action was not actually performed because the data source is marked with disable_destructive_rebuild : param skip : If True the action will not be logged .
def _log_action(self, initiated_by, source, action, diffs=None, skip_destructive=False, skip=False):
        """
        :param initiated_by: Username of initiating user
        :param source: Source of action
        :param action: Action being performed. See ``DataSourceActionLog.action`` for options.
        :param diffs: Migration diff dict
        :param skip_destructive: True if this action was not actually performed because the data source
                                 is marked with ``disable_destructive_rebuild``
        :param skip: If True the action will not be logged.
        """
        from corehq.apps.userreports.models import DataSourceActionLog
        if skip or not self.config.data_source_id:
            return

        kwargs = {
            'domain': self.config.domain,
            'indicator_config_id': self.config.data_source_id,
            'action': action,
            'initiated_by': initiated_by,
            'action_source': source,
            'migration_diffs': diffs,
            'skip_destructive': skip_destructive,
        }

        try:
            # make this atomic so that errors don't affect outer transactions
            with transaction.atomic():
                log = DataSourceActionLog.objects.create(**kwargs)
        except (KeyboardInterrupt, SystemExit):
            raise
        except:  # noqa
            # catchall to make sure errors here don't interfere with real workflows
            notify_exception(None, "Error saving UCR action log", details=kwargs)
        else:
            skipped_destructive_rebuild_assert(not skip_destructive, "Destructive UCR action skipped", {
                'indicator_config_id': self.config.data_source_id,
                'action': action,
                'action_log_url': absolute_reverse('admin:userreports_datasourceactionlog_change', args=(log.id,))
            })
def _log_action ( self , initiated_by , source , action , diffs = None , skip_destructive = False , skip = False ) : from corehq . apps . userreports . models import DataSourceActionLog if skip or not self . config . data_source_id : return kwargs = { 'domain' : self . config . domain , 'indicator_config_id' : self . config . data_source_id , 'action' : action , 'initiated_by' : initiated_by , 'action_source' : source , 'migration_diffs' : diffs , 'skip_destructive' : skip_destructive , } try : # make this atomic so that errors don't affect outer transactions with transaction . atomic ( ) : log = DataSourceActionLog . objects . create ( * * kwargs ) except ( KeyboardInterrupt , SystemExit ) : raise except : # noqa # catchall to make sure errors here don't interfere with real workflows notify_exception ( None , "Error saving UCR action log" , details = kwargs ) else : skipped_destructive_rebuild_assert ( not skip_destructive , "Destructive UCR action skipped" , { 'indicator_config_id' : self . config . data_source_id , 'action' : action , 'action_log_url' : absolute_reverse ( 'admin:userreports_datasourceactionlog_change' , args = ( log . id , ) ) } )