diff --git a/api/migrations/0008_remove_supplierprofile_support_email_and_more.py b/api/migrations/0008_remove_supplierprofile_support_email_and_more.py new file mode 100644 index 0000000..30e5f20 --- /dev/null +++ b/api/migrations/0008_remove_supplierprofile_support_email_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 6.1 on 2026-09-05 10:32 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0007_sellerkyc_pan_aadhaar_linked_sellerkyc_pan_dob_and_more'), + ] + + operations = [ + migrations.RemoveField( + model_name='supplierprofile', + name='support_email', + ), + migrations.RemoveField( + model_name='supplierprofile', + name='support_phone', + ), + ] diff --git a/api/models.py b/api/models.py index 462e16d..db8fdfd 100644 --- a/api/models.py +++ b/api/models.py @@ -31,8 +31,6 @@ class SupplierProfile(models.Model): is_gstin_verified = models.BooleanField(default=False) business_type = models.CharField(max_length=50, choices=BUSINESS_TYPE_CHOICES, blank=True, null=True) store_slug = models.SlugField(max_length=255, unique=True, blank=True, null=True) - support_email = models.EmailField(blank=True, null=True) - support_phone = models.CharField(max_length=20, blank=True, null=True) categories = models.ManyToManyField(Category, blank=True, related_name='suppliers') aadhar_file = models.CharField(max_length=255, blank=True, null=True) # retaining old files or S3 keys pan_file = models.CharField(max_length=255, blank=True, null=True) diff --git a/api/tests.py b/api/tests.py index 558c9ac..202a53e 100644 --- a/api/tests.py +++ b/api/tests.py @@ -86,8 +86,6 @@ def test_profile_update(api_client, create_user): 'logo_s3_key': 'suppliers/1/logo.jpg', 'business_type': 'individual_maker', 'store_slug': 'new-artisan-handloom', - 'support_email': 'support@newartisan.com', - 'support_phone': '+919999988888', 'categories': ['Sustainable Products', 'Home Decor'] } response = api_client.put(url, data, format='json') @@ -97,8 +95,6 @@ def test_profile_update(api_client, create_user): assert create_user.profile.is_gstin_verified is True assert create_user.profile.business_type == 'individual_maker' assert create_user.profile.store_slug == 'new-artisan-handloom' - assert create_user.profile.support_email == 'support@newartisan.com' - assert create_user.profile.support_phone == '+919999988888' assert set(create_user.profile.categories.values_list('name', flat=True)) == {'Sustainable Products', 'Home Decor'} @pytest.mark.django_db diff --git a/api/views.py b/api/views.py index f3aec61..24147af 100644 --- a/api/views.py +++ b/api/views.py @@ -207,8 +207,6 @@ class ProfileView(APIView): profile.is_gstin_verified = request.data.get('is_gstin_verified', profile.is_gstin_verified) profile.business_type = request.data.get('business_type', profile.business_type) profile.store_slug = request.data.get('store_slug', profile.store_slug) - profile.support_email = request.data.get('support_email', profile.support_email) - profile.support_phone = request.data.get('support_phone', profile.support_phone) categories_data = request.data.get('categories') if categories_data is not None: diff --git a/config/settings.py b/config/settings.py index d95da71..f741266 100644 --- a/config/settings.py +++ b/config/settings.py @@ -55,7 +55,12 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -CORS_ALLOW_ALL_ORIGINS = True +# CORS_ALLOW_ALL_ORIGINS = True +CORS_ALLOWED_ORIGINS = [ + 'http://localhost:5173', # Vite local dev + 'http://127.0.0.1:5173', # Vite local dev + 'https://d1zlxfmkt834bg.cloudfront.net', # CloudFront betasupplier site +] CORS_ALLOW_CREDENTIALS = True