修复500问题

This commit is contained in:
huang 2016-12-27 12:33:08 +08:00
parent 8126353b43
commit e614a2d111
1 changed files with 3 additions and 0 deletions

View File

@ -917,6 +917,9 @@ class User < Principal
# 判断是否是竞赛的主办人
def admin_of_contest?(contest)
if contest.nil?
return false
end
if ContestMember.where("user_id =? and contest_id =?", self.id, contest.id).count == 0
return false
end