competition: fix

dev_sync_trustie
p31729568 5 years ago
parent 10e52f9c64
commit 03ab9469f1

@ -32,6 +32,6 @@ class Competitions::JoinTeamService < ApplicationService
raise Error, '该战队队员人数已满' if !is_teacher && team.members.count == competition.member_staff.maximum raise Error, '该战队队员人数已满' if !is_teacher && team.members.count == competition.member_staff.maximum
role = is_teacher ? 3 : 2 role = is_teacher ? 3 : 2
team.team_members.create!(competition_id: competition.id, user_id: user, role: role, is_teacher: is_teacher) team.team_members.create!(competition_id: competition.id, user_id: user.id, role: role, is_teacher: is_teacher)
end end
end end
Loading…
Cancel
Save