班级成员列表报500

This commit is contained in:
cxt 2017-02-22 10:35:33 +08:00
parent 422b5ffa95
commit f41341a3d4
2 changed files with 11 additions and 1 deletions

View File

@ -1237,6 +1237,16 @@ class User < Principal
Thread.current[:current_user] ||= User.anonymous
end
def user_real_extension
ue = self.user_extensions
if ue.nil?
ue = UserExtensions.new
ue.user_id = self.id
ue.save
end
ue
end
# Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
# one anonymous user per database.
def self.anonymous

View File

@ -83,7 +83,7 @@
<%= link_to user.show_name, user_path(user), :class => 'fl sy_class_users_st_name' ,:title => "#{user.show_name}", :target => '_blank' %>
</td>
<td>
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
<span class="sy_class_users_st_num" title="<%= user.user_real_extension.student_id %>"><%= user.user_real_extension.student_id %></span>
</td>
<td>
<% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %>