Allow internal users to switch their current study group

This commit is contained in:
Sebastian Serth
2022-09-26 16:22:00 +02:00
parent 89c0f52ff3
commit 4b00eb1e8c
2 changed files with 1 additions and 5 deletions

View File

@ -37,8 +37,4 @@ class InternalUser < User
def displayname
name
end
def current_study_group_id
study_groups.find_by(external_id: nil)&.id
end
end

View File

@ -30,7 +30,7 @@ FactoryBot.define do
end
user.study_group_memberships.update(role: 'teacher') if evaluator.teacher_in_study_group
user.store_current_study_group_id(user.study_group_memberships.first)
user.store_current_study_group_id(user.study_group_memberships.first.study_group_id)
end
end
end