Compare commits
16 Commits
8337f68a01
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| f340b56218 | |||
| fcba840ce9 | |||
| 0d99e508ac | |||
| 315f50e18f | |||
| a931980d09 | |||
| d01dd1034b | |||
| 9d494ab34e | |||
| 1a844132e6 | |||
| 85dcbd8808 | |||
| 5f0df931a7 | |||
| d38d2cd800 | |||
| 6204a57f86 | |||
| 4af4b0c02f | |||
| 6402a5b418 | |||
| 09d66613ea | |||
| b1787200d7 |
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -31,7 +31,7 @@ pipeline {
|
||||
}
|
||||
stage('Checkout Code') {
|
||||
steps {
|
||||
git branch: 'main', credentialsId: 'ssh', url: 'git@github.com:JscorpTech/uzxarid.git'
|
||||
git branch: 'dev', credentialsId: 'muhammadvadud', url: 'https://gitea.felixits.uz/uzxarid/backend.git'
|
||||
}
|
||||
}
|
||||
stage('Prepare') {
|
||||
|
||||
@@ -5,8 +5,12 @@ CHANNEL_LAYERS = {
|
||||
"default": {
|
||||
"BACKEND": "channels_redis.core.RedisChannelLayer",
|
||||
"CONFIG": {
|
||||
"hosts": [(env.str("REDIS_HOST", "redis"), env.int("REDIS_PORT", 6379))],
|
||||
"hosts": [
|
||||
(
|
||||
env.str("REDIS_HOST", "redis"),
|
||||
env.int("REDIS_PORT_6379_TCP_PORT", 6379)
|
||||
)
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
"MinimumLengthValidator",
|
||||
"CommonPasswordValidator",
|
||||
"NumericPasswordValidator"
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
TIME_ZONE = "Asia/Tashkent"
|
||||
|
||||
@@ -19,12 +19,6 @@ class LoginSerializer(serializers.Serializer):
|
||||
class RegisterSerializer(serializers.ModelSerializer):
|
||||
phone = serializers.CharField(max_length=255)
|
||||
|
||||
def validate_phone(self, value):
|
||||
user = get_user_model().objects.filter(phone=value, validated_at__isnull=False)
|
||||
if user.exists():
|
||||
raise exceptions.ValidationError(_("Phone number already registered."), code="unique")
|
||||
return value
|
||||
|
||||
class Meta:
|
||||
model = get_user_model()
|
||||
fields = ["phone"]
|
||||
|
||||
14
core/apps/api/migrations/0016_merge_20251202_1732.py
Normal file
14
core/apps/api/migrations/0016_merge_20251202_1732.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Generated by Django 5.2.7 on 2025-12-02 12:32
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('api', '0014_category_name_en_category_name_ru_category_name_uz'),
|
||||
('api', '0015_alter_adoption_ad'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
@@ -24,8 +24,13 @@ class UserService(sms.SmsService):
|
||||
"phone": phone,
|
||||
},
|
||||
)
|
||||
if user.is_superuser:
|
||||
user.is_superuser = True
|
||||
user.save()
|
||||
return user
|
||||
user.set_unusable_password()
|
||||
user.save()
|
||||
return user
|
||||
|
||||
def send_confirmation(self, phone) -> bool:
|
||||
try:
|
||||
@@ -40,6 +45,7 @@ class UserService(sms.SmsService):
|
||||
"""
|
||||
Create user if user not found
|
||||
"""
|
||||
|
||||
if user.validated_at is None:
|
||||
user.validated_at = datetime.now()
|
||||
user.save()
|
||||
|
||||
20
stack.yaml
20
stack.yaml
@@ -6,9 +6,7 @@ services:
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_DB=uzxarid
|
||||
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
|
||||
secrets:
|
||||
- postgres_password
|
||||
- POSTGRES_PASSWORD=5432
|
||||
networks:
|
||||
- uzxarid
|
||||
volumes:
|
||||
@@ -34,7 +32,7 @@ services:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d uzxarid"]
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres -d uzxarid" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -47,7 +45,7 @@ services:
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
command: ["redis-server", "--appendonly", "yes"]
|
||||
command: [ "redis-server", "--appendonly", "yes" ]
|
||||
networks:
|
||||
- uzxarid
|
||||
volumes:
|
||||
@@ -72,7 +70,7 @@ services:
|
||||
cpus: '0.50'
|
||||
memory: 256M
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
test: [ "CMD", "redis-cli", "ping" ]
|
||||
interval: 15s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
@@ -117,7 +115,7 @@ services:
|
||||
cpus: '1.50'
|
||||
memory: 1024M
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:8000/health/ || exit 1"]
|
||||
test: [ "CMD-SHELL", "curl -f http://localhost:8000/health/ || exit 1" ]
|
||||
interval: 15s
|
||||
timeout: 15s
|
||||
retries: 5
|
||||
@@ -133,7 +131,7 @@ services:
|
||||
ports:
|
||||
- mode: ingress
|
||||
target: 80
|
||||
published: ${PORT:?enviromentda PORT topilmadi}
|
||||
published: 8034
|
||||
protocol: tcp
|
||||
volumes:
|
||||
- type: bind
|
||||
@@ -167,7 +165,7 @@ services:
|
||||
- /var/run
|
||||
- /var/tmp
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost/health/ || exit 1"]
|
||||
test: [ "CMD-SHELL", "curl -f http://localhost/health/ || exit 1" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -196,7 +194,3 @@ volumes:
|
||||
driver: local
|
||||
logs:
|
||||
driver: local
|
||||
|
||||
secrets:
|
||||
postgres_password:
|
||||
external: true
|
||||
|
||||
Reference in New Issue
Block a user