Skip to content

Commit

Permalink
[CPDLP-3878] Include non active participant profiles to course valida…
Browse files Browse the repository at this point in the history
…tor and participant profile resolver
  • Loading branch information
leandroalemao committed Dec 20, 2024
1 parent 0fc3cd5 commit d78c8e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions app/services/participant_profile_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ def call(participant_identity:, course_identifier:, cpd_lead_provider:)
if ParticipantProfile::ECT::COURSE_IDENTIFIERS.include?(course_identifier)
participant_identity
.participant_profiles
.active_record
.ects
.first
elsif ParticipantProfile::Mentor::COURSE_IDENTIFIERS.include?(course_identifier)
participant_identity
.participant_profiles
.active_record
.mentors
.first
elsif NPQCourse.identifiers.include?(course_identifier)
Expand Down
2 changes: 1 addition & 1 deletion app/validators/course_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def validate(record)
def has_profile_for_course_given_course_identifier?(record)
return unless record.participant_identity&.user

record.participant_identity.user.participant_profiles.active_record.any? do |participant_profile|
record.participant_identity.user.participant_profiles.any? do |participant_profile|
participant_profile.class::COURSE_IDENTIFIERS.include?(record.course_identifier)
end
end
Expand Down

0 comments on commit d78c8e3

Please sign in to comment.