'Wrapper around calls to fire the course_published 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:
course_key - course_key to which the signal applies'

def _flag_publish_event(self, course_key):

    if self.signal_handler:
        bulk_record = (self._get_bulk_ops_record(course_key) if isinstance(self, BulkOperationsMixin) else None)
        if (bulk_record and bulk_record.active):
            bulk_record.has_publish_item = True
        else:
            self.signal_handler.send('course_published', course_key=course_key.for_branch(None))
