File tree Expand file tree Collapse file tree
lms/djangoapps/ci_program Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414 steps :
1515 - uses : actions/checkout@v2
16- - name : Install AWS CLI
17- run : sudo apt-get update -y && sudo apt-get install -y awscli
1816 - run : docker info
1917 - name : Docker Login
2018 run : AWS_DEFAULT_REGION=eu-west-1 AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY}} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} aws ecr get-login-password | docker login --username AWS --password-stdin 949266541515.dkr.ecr.eu-west-1.amazonaws.com/ci-edx-platform
Original file line number Diff line number Diff line change @@ -302,7 +302,14 @@ def _get_or_infer_block_id(
302302 children = course_xblock .get ('fields' , {}).get ('children' )
303303 if children :
304304 activity_state = json .loads (activity_log [0 ].state )
305- section_block = children [activity_state .get ('position' , 1 ) - 1 ]
305+ # Bugs have occured when student was enrolled in multiple runs
306+ # of the same course where the number of children was different
307+ child_index = activity_state .get ('position' , 1 ) - 1
308+ if len (children ) > child_index :
309+ section_block = children [child_index ]
310+ else :
311+ log .warning ("Activity log position out of sync with course: %s %s" , child_index , course_key )
312+ section_block = children [0 ]
306313 block_id = section_block [1 ] if section_block else None
307314 return block_id
308315
You can’t perform that action at this time.
0 commit comments