From 40e39079d5cfe11e4bce4c5fccff50da8d97d478 Mon Sep 17 00:00:00 2001 From: Sam Dudley Date: Mon, 9 Dec 2024 18:14:13 +0000 Subject: [PATCH 1/2] Fix image_build_run.sh script (#573) --- .copilot/image_build_run.sh | 5 +- ...alter_fileupload_document_type_and_more.py | 77 +++++++++++++++++++ upload_file/models.py | 4 +- 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 upload_file/migrations/0007_alter_fileupload_document_type_and_more.py diff --git a/.copilot/image_build_run.sh b/.copilot/image_build_run.sh index b87c0039a..ffabdbfe7 100755 --- a/.copilot/image_build_run.sh +++ b/.copilot/image_build_run.sh @@ -3,7 +3,10 @@ # Exit early if something goes wrong set -e +export DJANGO_SETTINGS_MODULE=config.settings.ci + +cp .env.ci .env + # Add commands below to run inside the container after all the other buildpacks have been applied -export $(grep -v '^#' .env.ci | xargs) python manage.py collectstatic --noinput diff --git a/upload_file/migrations/0007_alter_fileupload_document_type_and_more.py b/upload_file/migrations/0007_alter_fileupload_document_type_and_more.py new file mode 100644 index 000000000..091ff1c5c --- /dev/null +++ b/upload_file/migrations/0007_alter_fileupload_document_type_and_more.py @@ -0,0 +1,77 @@ +# Generated by Django 5.1.3 on 2024-12-09 17:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("upload_file", "0006_alter_simplehistoryfileupload_options_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="fileupload", + name="document_type", + field=models.CharField( + choices=[ + ("actuals", "Actuals"), + ("budget", "Budget"), + ("previousyear", "Previous Year"), + ("projectpercentage", "Project Percentages"), + ("forecast", "Forecast"), + ("other", "Other"), + ], + default="actuals", + max_length=100, + ), + ), + migrations.AlterField( + model_name="fileupload", + name="file_location", + field=models.CharField( + choices=[ + ("actuals", "Actuals"), + ("budget", "Budget"), + ("previousyear", "Previous Year"), + ("projectpercentage", "Project Percentages"), + ("forecast", "Forecast"), + ("other", "Other"), + ], + default="S3", + max_length=100, + ), + ), + migrations.AlterField( + model_name="simplehistoryfileupload", + name="document_type", + field=models.CharField( + choices=[ + ("actuals", "Actuals"), + ("budget", "Budget"), + ("previousyear", "Previous Year"), + ("projectpercentage", "Project Percentages"), + ("forecast", "Forecast"), + ("other", "Other"), + ], + default="actuals", + max_length=100, + ), + ), + migrations.AlterField( + model_name="simplehistoryfileupload", + name="file_location", + field=models.CharField( + choices=[ + ("actuals", "Actuals"), + ("budget", "Budget"), + ("previousyear", "Previous Year"), + ("projectpercentage", "Project Percentages"), + ("forecast", "Forecast"), + ("other", "Other"), + ], + default="S3", + max_length=100, + ), + ), + ] diff --git a/upload_file/models.py b/upload_file/models.py index 1d2c778e8..59fddcc58 100644 --- a/upload_file/models.py +++ b/upload_file/models.py @@ -37,8 +37,8 @@ class FileUpload(BaseModel): (BUDGET, "Budget"), (PREVIOUSYEAR, "Previous Year"), (PROJECT_PERCENTAGE, "Project Percentages"), - {FORECAST, "Forecast"}, - {OTHER, "Other"}, + (FORECAST, "Forecast"), + (OTHER, "Other"), ] LOCALFILE = "local" From 0a0a883c399261aa28f9effd60a6a08cc5266983 Mon Sep 17 00:00:00 2001 From: Sam Dudley Date: Tue, 10 Dec 2024 10:14:17 +0000 Subject: [PATCH 2/2] Fix image_build_run.sh script (#575) --- .copilot/image_build_run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.copilot/image_build_run.sh b/.copilot/image_build_run.sh index ffabdbfe7..50f8cffc2 100755 --- a/.copilot/image_build_run.sh +++ b/.copilot/image_build_run.sh @@ -10,3 +10,6 @@ cp .env.ci .env # Add commands below to run inside the container after all the other buildpacks have been applied python manage.py collectstatic --noinput + +# Cleanup +rm .env