figures/tasks.py
def populate_course_mau(site_id, course_id, month_for=None, force_update=False):
    """Populates the MAU for the given site, course, and month
    """
    if month_for:
        month_for = as_date(month_for)
    else:
        month_for = datetime.datetime.utcnow().date()
    site = Site.objects.get(id=site_id)
    start_time = time.time()
    obj, _created = collect_course_mau(site=site,
                                       courselike=course_id,
                                       month_for=month_for,
                                       overwrite=force_update)
    if not obj:
        msg = 'populate_course_mau failed for course {course_id}'.format(
            course_id=str(course_id))
        logger.error(msg)
    elapsed_time = time.time() - start_time
    logger.info('populate_course_mau Elapsed time (seconds)={}. cdm_obj={}'.format(
        elapsed_time, obj))
Populates the MAU for the given site, course, and month
    
Populates the MAU for the given site, course, and month
Populates the MAU for the given site course and month
def populate_course_mau(site_id, course_id, month_for=None, force_update=False):
    if month_for:
        month_for = as_date(month_for)
    else:
        month_for = datetime.datetime.utcnow().date()
    site = Site.objects.get(id=site_id)
    start_time = time.time()
    obj, _created = collect_course_mau(site=site,
                                       courselike=course_id,
                                       month_for=month_for,
                                       overwrite=force_update)
    if not obj:
        msg = 'populate_course_mau failed for course {course_id}'.format(
            course_id=str(course_id))
        logger.error(msg)
    elapsed_time = time.time() - start_time
    logger.info('populate_course_mau Elapsed time (seconds)={}. cdm_obj={}'.format(
        elapsed_time, obj))
def populate_course_mau ( site_id , course_id , month_for = None , force_update = False ) : if month_for : month_for = as_date ( month_for ) else : month_for = datetime . datetime . utcnow ( ) . date ( ) site = Site . objects . get ( id = site_id ) start_time = time . time ( ) obj , _created = collect_course_mau ( site = site , courselike = course_id , month_for = month_for , overwrite = force_update ) if not obj : msg = 'populate_course_mau failed for course {course_id}' . format ( course_id = str ( course_id ) ) logger . error ( msg ) elapsed_time = time . time ( ) - start_time logger . info ( 'populate_course_mau Elapsed time (seconds)={}. cdm_obj={}' . format ( elapsed_time , obj ) )
Populates the MAU for the given site, course, and month
Populates the MAU for the given site course and month
"""Populates the MAU for the given site, course, and month
    """
site_id
course_id
month_for
force_update