...
 
Commits (5)
......@@ -75,7 +75,7 @@ export class ApiService {
exportReport({ reportId, type }: { reportId: number; type: IExportType }) {
return this.http.get<IAsyncTaskId>(
`report/${reportId}/download_file/${type}/`
`api/report/${reportId}/download_file/${type}/`
);
}
......@@ -87,7 +87,7 @@ export class ApiService {
taskId: string;
}) {
return this.http.get<ITaskStatus>(
`report/${reportId}/check_status/${taskId}/`
`api/report/${reportId}/check_status/${taskId}/`
);
}
......
......@@ -184,7 +184,7 @@ export class ReportEffects {
return Observable.create(observer => {
observer.next(
new fromReports.DownloadExportedReport(
`/report_builder/report/${reportId}/download_file/${type}/`
`api/report/${reportId}/download_file/${type}/`
)
);
observer.complete();
......
......@@ -443,7 +443,7 @@ class Report(models.Model):
csv_file = data_export.list_to_csv_file(objects_list, title,
header, widths)
title = generate_filename(title, '.csv')
self.report_file.save(title, ContentFile(csv_file.getvalue()))
self.report_file.save(title, ContentFile(csv_file.getvalue().encode()))
else:
xlsx_file = data_export.list_to_xlsx_file(objects_list, title,
header, widths)
......
......@@ -25,6 +25,8 @@ urlpatterns = [
url(r'^api/related_fields', staff_member_required(api_views.RelatedFieldsView.as_view()), name="related_fields"),
url(r'^api/fields', staff_member_required(api_views.FieldsView.as_view()), name="fields"),
url(r'^api/report/(?P<report_id>\w+)/generate/', staff_member_required(api_views.GenerateReport.as_view()), name="generate_report"),
url(r'^api/report/(?P<pk>\d+)/download_file/(?P<filetype>.+)/$', views.DownloadFileView.as_view(), name="report_download_file"),
url(r'^api/report/(?P<pk>\d+)/check_status/(?P<task_id>.+)/$', views.check_status, name="report_check_status"),
url('^report/(?P<pk>\d+)/$', views.ReportSPAView.as_view(), name="report_update_view"),
]
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="django-report-builder",
version="6.0.1",
version="6.0.2",
author="David Burke",
author_email="david@burkesoftware.com",
description=("Query and Report builder for Django ORM"),
......