Compare commits
2 commits
3f369c7eb5
...
2e604f1c6f
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e604f1c6f | |||
| 7949cc2d36 |
6 changed files with 33 additions and 10 deletions
|
|
@ -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 ─────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue