feat: Implement comprehensive database schema with new models, CRUD operations, and documentation for host metrics, Docker management, and terminal sessions, while removing old test files.
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
This commit is contained in:
+20
-12
@@ -74,18 +74,26 @@ async def setup_admin(
|
||||
detail="Le setup a déjà été effectué. Utilisez /login pour vous connecter."
|
||||
)
|
||||
|
||||
# Hasher le mot de passe
|
||||
hashed_password = auth_service.hash_password(user_data.password)
|
||||
|
||||
# Créer l'utilisateur admin
|
||||
user = await repo.create(
|
||||
username=user_data.username,
|
||||
hashed_password=hashed_password,
|
||||
email=user_data.email,
|
||||
display_name=user_data.display_name,
|
||||
role="admin"
|
||||
)
|
||||
await db_session.commit()
|
||||
try:
|
||||
# Hasher le mot de passe
|
||||
hashed_password = auth_service.hash_password(user_data.password)
|
||||
|
||||
# Créer l'utilisateur admin
|
||||
user = await repo.create(
|
||||
username=user_data.username,
|
||||
hashed_password=hashed_password,
|
||||
email=user_data.email,
|
||||
display_name=user_data.display_name,
|
||||
role="admin"
|
||||
)
|
||||
await db_session.commit()
|
||||
except Exception as e:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail=f"Erreur lors de la création du compte: {str(e)}"
|
||||
)
|
||||
|
||||
return {
|
||||
"message": "Compte administrateur créé avec succès",
|
||||
|
||||
Reference in New Issue
Block a user