From 4328f3f7153c0e9f7d93212825c5c29c99cf2aa3 Mon Sep 17 00:00:00 2001 From: Ashish Acharya Date: Wed, 6 Dec 2023 09:41:40 -0600 Subject: [PATCH 1/2] Add CORS header exceptions --- config/settings/base.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index b7946b87..0ab1b206 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -66,14 +66,28 @@ "django_extensions", ] THIRD_PARTY_APPS = [ - "crispy_forms", - "crispy_bootstrap5", - "allauth", "allauth.account", "allauth.socialaccount", + "allauth", + "corsheaders", + "crispy_bootstrap5", + "crispy_forms", "django_celery_beat", - "rest_framework", "rest_framework_datatables", + "rest_framework", +] + +CORS_ALLOWED_ORIGINS = [ + "http://localhost:3000", + "http://sde-lrm.nasa-impact.net", + "https://sde-qa.nasa-impact.net", + "https://sciencediscoveryengine.test.nasa.gov", + "https://sciencediscoveryengine.nasa.gov", + "http://sde-qa.nasa-impact.net", + "http://sciencediscoveryengine.test.nasa.gov", + "http://sciencediscoveryengine.nasa.gov", + "https://localhost:4200", + "http://localhost:4200", ] LOCAL_APPS = ["sde_indexing_helper.users", "sde_collections", "feedback"] From 502ede151af0bb0c038b897c52df86daddf70a9c Mon Sep 17 00:00:00 2001 From: Ashish Acharya Date: Wed, 6 Dec 2023 09:51:02 -0600 Subject: [PATCH 2/2] Make additional info field blankable --- ...er_contentcurationrequest_additional_info.py | 17 +++++++++++++++++ feedback/models.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 feedback/migrations/0002_alter_contentcurationrequest_additional_info.py diff --git a/feedback/migrations/0002_alter_contentcurationrequest_additional_info.py b/feedback/migrations/0002_alter_contentcurationrequest_additional_info.py new file mode 100644 index 00000000..c9250b51 --- /dev/null +++ b/feedback/migrations/0002_alter_contentcurationrequest_additional_info.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-12-06 15:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("feedback", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="contentcurationrequest", + name="additional_info", + field=models.TextField(blank=True, default=""), + ), + ] diff --git a/feedback/models.py b/feedback/models.py index 31adc044..bc82b41a 100644 --- a/feedback/models.py +++ b/feedback/models.py @@ -18,7 +18,7 @@ class ContentCurationRequest(models.Model): scientific_focus = models.CharField(max_length=200) data_type = models.CharField(max_length=100) data_link = models.CharField(max_length=1000) - additional_info = models.TextField() + additional_info = models.TextField(default="", blank=True) class Meta: verbose_name = "Content Curation Request"