Skip to content

Commit

Permalink
Merge pull request WING-NUS#197 from nguyen-mai-huong/master
Browse files Browse the repository at this point in the history
fix bug: failed to create guest entry the first time when guest just …
  • Loading branch information
nguyen-mai-huong authored Aug 5, 2022
2 parents 971d209 + f04dad5 commit ada8bcf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/submission_logs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ def view_similarity
if membership.nil?
# Create a guest membership for current user
CoursesService.create_guest_membership(course, @user)
end

if membership && membership.role == UserCourseMembership::ROLE_GUEST && has_guest_detail.nil?
CoursesService.create_guest_detail_entry(@assignment, @user)
else
if membership.role == UserCourseMembership::ROLE_GUEST && has_guest_detail.nil?
CoursesService.create_guest_detail_entry(@assignment, @user)
end
end
end

Expand Down

0 comments on commit ada8bcf

Please sign in to comment.