Compare commits

...

2 commits

Author SHA1 Message Date
2e604f1c6f ci: configure node:22-alpine container with git and update database host IP in beta workflow
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 1m4s
2026-09-06 15:13:35 +05:30
7949cc2d36 refactor: remove support contact fields from SupplierProfile and restrict CORS allowed origins
Some checks failed
Deploy Beta (NATIVE) / deploy (push) Failing after 26s
2026-09-05 16:04:01 +05:30
6 changed files with 33 additions and 10 deletions

View file

@ -8,7 +8,12 @@ on:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: node:22-alpine
steps: steps:
- name: Install git
run: apk add --no-cache git
- name: Checkout Code - name: Checkout Code
uses: https://github.com/actions/checkout@v4 uses: https://github.com/actions/checkout@v4
@ -78,7 +83,7 @@ jobs:
echo "DEBUG=0" > .env echo "DEBUG=0" > .env
echo "DB_USER=vignesh" >> .env echo "DB_USER=vignesh" >> .env
echo "DB_PASSWORD=vtechnosoft@123A" >> .env echo "DB_PASSWORD=vtechnosoft@123A" >> .env
echo "DB_HOST=127.0.0.1" >> .env echo "DB_HOST=16.113.106.152" >> .env
echo "DB_PORT=5432" >> .env echo "DB_PORT=5432" >> .env
# ── 6. Run Database Migrations ───────────────────────────────── # ── 6. Run Database Migrations ─────────────────────────────────

View file

@ -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',
),
]

View file

@ -31,8 +31,6 @@ class SupplierProfile(models.Model):
is_gstin_verified = models.BooleanField(default=False) is_gstin_verified = models.BooleanField(default=False)
business_type = models.CharField(max_length=50, choices=BUSINESS_TYPE_CHOICES, blank=True, null=True) 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) 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') 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 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) pan_file = models.CharField(max_length=255, blank=True, null=True)

View file

@ -86,8 +86,6 @@ def test_profile_update(api_client, create_user):
'logo_s3_key': 'suppliers/1/logo.jpg', 'logo_s3_key': 'suppliers/1/logo.jpg',
'business_type': 'individual_maker', 'business_type': 'individual_maker',
'store_slug': 'new-artisan-handloom', 'store_slug': 'new-artisan-handloom',
'support_email': 'support@newartisan.com',
'support_phone': '+919999988888',
'categories': ['Sustainable Products', 'Home Decor'] 'categories': ['Sustainable Products', 'Home Decor']
} }
response = api_client.put(url, data, format='json') 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.is_gstin_verified is True
assert create_user.profile.business_type == 'individual_maker' assert create_user.profile.business_type == 'individual_maker'
assert create_user.profile.store_slug == 'new-artisan-handloom' 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'} assert set(create_user.profile.categories.values_list('name', flat=True)) == {'Sustainable Products', 'Home Decor'}
@pytest.mark.django_db @pytest.mark.django_db

View file

@ -207,8 +207,6 @@ class ProfileView(APIView):
profile.is_gstin_verified = request.data.get('is_gstin_verified', profile.is_gstin_verified) 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.business_type = request.data.get('business_type', profile.business_type)
profile.store_slug = request.data.get('store_slug', profile.store_slug) 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') categories_data = request.data.get('categories')
if categories_data is not None: if categories_data is not None:

View file

@ -55,7 +55,12 @@ MIDDLEWARE = [
'django.middleware.clickjacking.XFrameOptionsMiddleware', '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 CORS_ALLOW_CREDENTIALS = True