@@ -1485,40 +1485,45 @@ def post(self, request, course_id, csv=False): # pylint: disable=redefined-oute
14851485 # We need to clone the list because we modify it below
14861486 query_features = list (configuration_helpers .get_value ('student_profile_download_fields' , []))
14871487
1488- if not query_features :
1489- query_features = [
1490- 'id' , 'username' , 'name' , 'email' , 'language' , 'location' ,
1491- 'year_of_birth' , 'gender' , 'level_of_education' , 'mailing_address' ,
1492- 'goals' , 'enrollment_mode' , 'last_login' , 'date_joined' , 'external_user_key'
1493- ]
1494- keep_field_private (query_features , 'year_of_birth' ) # protected information
1495-
1496- # Provide human-friendly and translatable names for these features. These names
1497- # will be displayed in the table generated in data_download.js. It is not (yet)
1498- # used as the header row in the CSV, but could be in the future.
1499- query_features_names = {
1500- 'id' : _ ('User ID' ),
1501- 'username' : _ ('Username' ),
1502- 'name' : _ ('Name' ),
1503- 'email' : _ ('Email' ),
1504- 'language' : _ ('Language' ),
1505- 'location' : _ ('Location' ),
1506- # 'year_of_birth': _('Birth Year'), treated as privileged information as of TNL-10683,
1507- # not to go in reports
1508- 'gender' : _ ('Gender' ),
1509- 'level_of_education' : _ ('Level of Education' ),
1510- 'mailing_address' : _ ('Mailing Address' ),
1511- 'goals' : _ ('Goals' ),
1512- 'enrollment_mode' : _ ('Enrollment Mode' ),
1513- 'last_login' : _ ('Last Login' ),
1514- 'date_joined' : _ ('Date Joined' ),
1515- 'external_user_key' : _ ('External User Key' ),
1516- }
1488+ if not query_features :
1489+ query_features = [
1490+ 'id' , 'username' , 'name' , 'email' , 'language' , 'location' ,
1491+ 'year_of_birth' , 'gender' , 'level_of_education' , 'mailing_address' ,
1492+ 'goals' , 'enrollment_mode' , 'verification_status' ,
1493+ 'last_login' , 'date_joined' , 'external_user_key' ,
1494+ 'enrollment_date'
1495+ ]
1496+
1497+ # Provide human-friendly and translatable names for these features. These names
1498+ # will be displayed in the table generated in data_download.js. It is not (yet)
1499+ # used as the header row in the CSV, but could be in the future.
1500+ query_features_names = {
1501+ 'id' : _ ('User ID' ),
1502+ 'username' : _ ('Username' ),
1503+ 'name' : _ ('Name' ),
1504+ 'email' : _ ('Email' ),
1505+ 'language' : _ ('Language' ),
1506+ 'location' : _ ('Location' ),
1507+ 'year_of_birth' : _ ('Birth Year' ),
1508+ 'gender' : _ ('Gender' ),
1509+ 'level_of_education' : _ ('Level of Education' ),
1510+ 'mailing_address' : _ ('Mailing Address' ),
1511+ 'goals' : _ ('Goals' ),
1512+ 'enrollment_mode' : _ ('Enrollment Mode' ),
1513+ 'last_login' : _ ('Last Login' ),
1514+ 'date_joined' : _ ('Date Joined' ),
1515+ 'external_user_key' : _ ('External User Key' ),
1516+ 'enrollment_date' : _ ('Enrollment Date' ),
1517+ }
1518+
1519+ if not settings .FEATURES .get ('SHOW_PRIVATE_FIELDS_IN_PROFILE_INFORMATION_REPORT' , False ):
1520+ keep_field_private (query_features , 'year_of_birth' )
1521+ query_features_names .pop ('year_of_birth' , None )
15171522
1518- if is_course_cohorted (course .id ):
1519- # Translators: 'Cohort' refers to a group of students within a course.
1520- query_features .append ('cohort' )
1521- query_features_names ['cohort' ] = _ ('Cohort' )
1523+ if is_course_cohorted (course .id ):
1524+ # Translators: 'Cohort' refers to a group of students within a course.
1525+ query_features .append ('cohort' )
1526+ query_features_names ['cohort' ] = _ ('Cohort' )
15221527
15231528 if course .teams_enabled :
15241529 query_features .append ('team' )
0 commit comments