Merge pull request #20684 from open-craft/clemente/support-date-columns-in-student-csv-export

Add last_login and date_joined to the student profile export
This commit is contained in:
David Ormsbee
2019-12-10 18:20:40 -05:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -1317,6 +1317,7 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
'id', 'username', 'name', 'email', 'language', 'location',
'year_of_birth', 'gender', 'level_of_education', 'mailing_address',
'goals', 'enrollment_mode', 'verification_status',
'last_login', 'date_joined',
]
# Provide human-friendly and translatable names for these features. These names
@@ -1336,6 +1337,8 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
'goals': _('Goals'),
'enrollment_mode': _('Enrollment Mode'),
'verification_status': _('Verification Status'),
'last_login': _('Last Login'),
'date_joined': _('Date Joined'),
}
if is_course_cohorted(course.id):

View File

@@ -39,7 +39,8 @@ from student.models import CourseEnrollment, CourseEnrollmentAllowed
log = logging.getLogger(__name__)
STUDENT_FEATURES = ('id', 'username', 'first_name', 'last_name', 'is_staff', 'email')
STUDENT_FEATURES = ('id', 'username', 'first_name', 'last_name', 'is_staff', 'email',
'date_joined', 'last_login')
PROFILE_FEATURES = ('name', 'language', 'location', 'year_of_birth', 'gender',
'level_of_education', 'mailing_address', 'goals', 'meta',
'city', 'country')