Return task ID and generated filename from backend

This commit is contained in:
Eugeny Kolpakov
2018-05-10 08:49:10 +08:00
parent ea4d43e175
commit d058aacca9
5 changed files with 33 additions and 21 deletions

View File

@@ -26,18 +26,20 @@ def upload_csv_to_report_store(rows, csv_name, course_id, timestamp, config_name
]
csv_name: Name of the resulting CSV
course_id: ID of the course
Returns:
report_name: string - Name of the generated report
"""
report_store = ReportStore.from_config(config_name)
report_store.store_rows(
course_id,
u"{course_prefix}_{csv_name}_{timestamp_str}.csv".format(
course_prefix=course_filename_prefix_generator(course_id),
csv_name=csv_name,
timestamp_str=timestamp.strftime("%Y-%m-%d-%H%M")
),
rows
report_name = u"{course_prefix}_{csv_name}_{timestamp_str}.csv".format(
course_prefix=course_filename_prefix_generator(course_id),
csv_name=csv_name,
timestamp_str=timestamp.strftime("%Y-%m-%d-%H%M")
)
report_store.store_rows(course_id, report_name, rows)
tracker_emit(csv_name)
return report_name
def tracker_emit(report_name):