Skip to content

Commit

Permalink
Merge pull request openwebwork#2623 from somiaj/add-course-hotfix
Browse files Browse the repository at this point in the history
Hotfix: Prevent error when adding new course.
  • Loading branch information
drgrice1 authored Nov 18, 2024
2 parents c37af2b + e183ba6 commit f27977b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/WeBWorK/Utils/CourseManagement.pm
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ sub addCourse {
}
if ($options{copyNonStudents}) {
foreach my $userTriple (@users) {
my $user_id = $userTriple->[0]{user_id};
my $user_id = $userTriple->[0]{user_id};
next if $user_id eq $initialUser->[0]{user_id}; # Skip, will be assigned to all sets below.
my @user_sets = $db0->listUserSets($user_id);
assignSetsToUsers($db, $ce, \@user_sets, [$user_id]);
}
Expand All @@ -425,7 +426,8 @@ sub addCourse {
}
if ($options{copyNonStudents}) {
foreach my $userTriple (@users) {
my $user_id = $userTriple->[0]{user_id};
my $user_id = $userTriple->[0]{user_id};
next if $user_id eq $initialUser->[0]{user_id}; # Skip, was assigned to all achievements above.
my @user_achievements = $db0->listUserAchievements($user_id);
for my $achievement_id (@user_achievements) {
my $userAchievement = $db->newUserAchievement();
Expand Down

0 comments on commit f27977b

Please sign in to comment.