|
123456789101112131415161718192021222324252627282930313233343536373839 |
- class Settings:
- PROJECT_NAME: str = "VMS"
- PROJECT_VERSION: str = "1.0.0"
- POSTGRES_USER: str = "VMSBase"
- POSTGRES_PASSWORD = "VMSBasePass"
- POSTGRES_SERVER: str = "localhost"
- POSTGRES_PORT: str = "5432"
- POSTGRES_DB: str = "VMSData"
- DATABASE_URL = f"postgresql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_SERVER}:{POSTGRES_PORT}/{POSTGRES_DB}"
- ACCESS_TOKEN_EXPIRE: int = 60 * 24 * 7 # 7 days
- SECRET_KEY: str = "tH357aC6oA7ofCaN3yTffYkRh"
- ALGORITHM: str = "HS256"
- ALLOWED_TASK_STATUS: list = ["Pending", "In Progress", "Completed", "Cancelled"]
-
-
- settings = Settings()
-
-
- def createAdminAcc():
- from db.session import SessionLocal
- from db.repository.user import create_new_user
- from schemas.user import UserCreate
- from db.models.user import User
-
- db = SessionLocal()
- user = UserCreate(
- Email="madi.turgunov@nu.edu.kz",
- Password="1234567",
- Name="Madi",
- LastName="Turgunov",
- ContactNumber="+77071234567",
- Role="Admin",
- GovernmentId="123456789",
- Address="Nazarbayev University",
- )
- if db.query(User).filter(User.Email == user.Email).first():
- return False
- create_new_user(user=user, db=db)
- return True
|