Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Change ExportFile upload_to folder

IKarbowiakf50ce8a78901
diff --git a/saleor/csv/migrations/0003_auto_20200520_0247.py b/saleor/csv/migrations/0003_auto_20200520_0247.py
new file mode 100644
index 0000000000..17a828397a
--- /dev/null
+++ b/saleor/csv/migrations/0003_auto_20200520_0247.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.0.6 on 2020-05-20 07:47
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("csv", "0002_exportevent"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="exportfile",
+ name="content_file",
+ field=models.FileField(null=True, upload_to="export_files"),
+ ),
+ ]
diff --git a/saleor/csv/models.py b/saleor/csv/models.py
index ebe0573fd4..d2cbd795a7 100644
--- a/saleor/csv/models.py
+++ b/saleor/csv/models.py
@@ -10,7 +10,7 @@ from . import ExportEvents
class ExportFile(Job):
created_by = models.ForeignKey(User, related_name="jobs", on_delete=models.CASCADE)
- content_file = models.FileField(upload_to="csv_files", null=True)
+ content_file = models.FileField(upload_to="export_files", null=True)
class ExportEvent(models.Model):
diff --git a/tests/test_emails.py b/tests/test_emails.py
index 24cf2271f9..b460097ec6 100644
--- a/tests/test_emails.py
+++ b/tests/test_emails.py
@@ -382,7 +382,7 @@ def test_send_email_with_link_to_download_csv(
csv_emails.send_email_with_link_to_download_csv(export_file, "export_products")
template = csv_emails.EXPORT_TEMPLATES["export_products"]
ctx = {
- "csv_link": f"http://mirumee.com/media/csv_files/{file_mock.name}",
+ "csv_link": f"http://mirumee.com/media/export_files/{file_mock.name}",
"domain": "mirumee.com",
"logo_url": "http://mirumee.com/static/images/logo-light.svg",
"site_name": "mirumee.com",