From 1a15c0f56707da7fcaf9e991af98189495abd713 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jul 2016 19:25:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E4=BD=9C=E4=B8=9A=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .access_token | 2 +- app/controllers/users_controller.rb | 5 +++-- app/helpers/application_helper.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.access_token b/.access_token index 610b08d2e..2e228963c 100644 --- a/.access_token +++ b/.access_token @@ -1 +1 @@ -{"access_token":"oEEf8ZKAB8Y2G0o_xnTPkPJHKKk8iHkLC-f5ptvQ2nCMj9IpC86ivLD2-p38GfOkuG-HuQp3pWZqhs3NJXUMdPLWsr5k67hPZYuqg4ozLccx0xdLswapj0mn8ovZhK1tKIKiAFAOMO","expires_in":7200,"got_token_at":1467012449} \ No newline at end of file +{"access_token":"b_Pc60Dd5eyg_ut3cHbsjQO9EJJdj2Qj5F99o9LH9ltKSme7_FZ3Of22lWLL-K2V0siWzv-bd9PO0Dn-L1PBvIy9LhXa0qPVaFl6vTtZHR2kA8qjo1ps2ancya0t7KmzURGbAFAAXM","expires_in":7200,"got_token_at":1467976842} \ No newline at end of file diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5fe7efc51..6bca5753e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1046,11 +1046,12 @@ class UsersController < ApplicationController homework_detail_group.save if homework_detail_group if homework.homework_type != 3 - unless homework.course.nil? + students = homework.course.student + if !homework.course.nil? && !students.empty? name = homework.name name_str = name + "的作品提交" str = "" - homework.course.student.each do |student| + students.each do |student| if str != "" str += "," end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4ebb8eb80..23fd401fd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3282,7 +3282,7 @@ end def strip_html(text,len=0,endss="...") ss = "" - if text.length>0 + if !text.nil? && text.length>0 ss=text.gsub(/<\/?.*?>/, '').strip ss = ss.gsub(/ /, ' ')