'Wrapper around calls to fire the library_updated signal
Unless we\'re nested in an active bulk operation, this simply fires the signal
otherwise a publish will be signalled at the end of the bulk operation
Arguments:
library_key - library_key to which the signal applies'

def _flag_library_updated_event(self, library_key):

    if self.signal_handler:
        bulk_record = (self._get_bulk_ops_record(library_key) if isinstance(self, BulkOperationsMixin) else None)
        if (bulk_record and bulk_record.active):
            bulk_record.has_library_updated_item = True
        else:
            self.signal_handler.send('library_updated', library_key=library_key)
