fix analytics distribution with no data, add unit test, cleanup

This commit is contained in:
Miles Steele
2013-07-29 11:03:55 -04:00
parent f7989cb2ab
commit 2760938e15
6 changed files with 61 additions and 31 deletions

View File

@@ -36,7 +36,7 @@ def enrolled_students_features(course_id, features):
student_dict = dict((feature, getattr(student, feature))
for feature in student_features)
profile = student.profile
if not profile is None:
if profile is not None:
profile_dict = dict((feature, getattr(profile, feature))
for feature in profile_features)
student_dict.update(profile_dict)