Merge pull request #23871 from edx/ndalfonso/AA-138-banner-debug
add logs for debugging
This commit is contained in:
@@ -3,6 +3,7 @@ Common utilities for the course experience, including course outline.
|
||||
"""
|
||||
|
||||
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
|
||||
from completion.models import BlockCompletion
|
||||
@@ -19,6 +20,8 @@ from openedx.core.lib.cache_utils import request_cached
|
||||
from student.models import CourseEnrollment
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@request_cached()
|
||||
def get_course_outline_block_tree(request, course_id, user=None):
|
||||
@@ -270,6 +273,16 @@ def reset_deadlines_banner_should_display(course_key, request):
|
||||
if display_reset_dates_banner:
|
||||
break
|
||||
for subsection in section.get('children', []):
|
||||
if str(course_key) == 'course-v1:BabsonX+BPET.ACCx+2T2018':
|
||||
log.info('**********DEBUGGING FOR RESET DATES BANNER FOR %s**********', request.user.username)
|
||||
log.info(u'ALL SUBSECTION INFO: %s', subsection)
|
||||
log.info(u'SUBSECTION COMPLETE: %s', subsection.get('complete', True))
|
||||
log.info(u'SUBSECTION GRADED: %s', subsection.get('graded', False))
|
||||
log.info(
|
||||
u'SUBSECTION PAST DUE: %s',
|
||||
subsection.get('due', timezone.now() + timedelta(1)) < timezone.now(),
|
||||
)
|
||||
log.info('*********END**********')
|
||||
if (
|
||||
not subsection.get('complete', True)
|
||||
and subsection.get('graded', False)
|
||||
|
||||
Reference in New Issue
Block a user