Commit f79e9da0 by Jeff LaJoie Committed by GitHub

Merge pull request #15874 from edx/jlajoie/EDUCATOR-1135-add-null-check

EDUCATOR-1135: Adds in null check cohort management command
parents a23b7469 87db8fcf
...@@ -179,20 +179,20 @@ class Command(BaseCommand): ...@@ -179,20 +179,20 @@ class Command(BaseCommand):
verified_course_user_group_partition_group.partition_id, verified_course_user_group_partition_group.partition_id,
None None
) )
if (verified_partition_group_access if verified_partition_group_access:
and verified_course_user_group_partition_group.group_id in verified_partition_group_access): non_verified_track_access_groups = (set(verified_partition_group_access) -
print "Queueing XBlock at location: '%s' for Verified Content Group update " % item.location all_cohorted_track_group_ids)
set_verified_enrollment_track = True # If the item has group_access that is not the
# verified or audit group IDs then raise an error
# If the item has group_access that is not the # This only needs to be checked for this partition_group once
# verified or audit group IDs then raise an error if non_verified_track_access_groups:
# This only needs to be checked for this partition_group once errors.append(
non_verified_track_access_groups = set(verified_partition_group_access) - all_cohorted_track_group_ids "Non audit/verified cohorted content group set for xblock, location '%s' with IDs '%s'"
if non_verified_track_access_groups: % (item.location, non_verified_track_access_groups)
errors.append( )
"Non audit/verified cohorted content group set for xblock, location '%s' with IDs '%s'" if verified_course_user_group_partition_group.group_id in verified_partition_group_access:
% (item.location, non_verified_track_access_groups) print "Queueing XBlock at location: '%s' for Verified Content Group update " % item.location
) set_verified_enrollment_track = True
# Add the enrollment track ids to a group access array # Add the enrollment track ids to a group access array
enrollment_track_group_access = [] enrollment_track_group_access = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment