Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Student yaml fix #30

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config/students.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func students(per Per, course, assignment string, onlyForStudentsOrGroups ...str
studs = onlyForStudents
}

log.Debug().Interface("students", students).Msg("found students")
log.Debug().Interface("students", studs).Msg("found students")
sort.Strings(studs)
students := mkStudents(studs)
return students
Expand All @@ -78,6 +78,11 @@ func mkStudents(studs []string) []*Student {
for _, stud := range studs {
rawStud := stud
student := &Student{Raw: rawStud}

if strings.HasPrefix(stud, "-") {
log.Warn().Str("student in config", stud).Msg("student identifier starts with '-', did you miss the space after hyphen?")
}

// E-Mail?
if ev.NewSyntaxValidator().Validate(ev.NewInput(evmail.FromString(stud))).IsValid() {
log.Debug().Str("student in config", stud).Msg("is valid email")
Expand Down
Loading