Fix vote teacher selection can be empty

This commit is contained in:
Dominic Grimm 2022-03-08 10:54:30 +01:00
parent 4bf65a4d87
commit 78acebcd70
No known key found for this signature in database
GPG key ID: 27C59510125F3C8A

View file

@ -143,6 +143,8 @@ module Backend
def create_vote(context : Context, input : VoteCreateInput) : Vote
context.student!
raise "Teacher selection can't be empty" if input.teacher_ids.empty?
skif = context.external.as(Db::Student).skif
input.teacher_ids.each do |id|
teacher = Db::Teacher.find(id)