Fix bug when updating compute password to be empty

This commit is contained in:
grossmj 2026-02-16 19:23:46 +08:00
parent 0a118dc9e7
commit bfed330ec2
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7

View File

@ -69,10 +69,7 @@ class ComputesRepository(BaseRepository):
async def update_compute(self, compute_id: UUID, compute_update: schemas.ComputeUpdate) -> Optional[models.Compute]:
update_values = compute_update.model_dump(exclude_unset=True)
password = compute_update.password
if password:
update_values["password"] = password.get_secret_value()
update_values["password"] = compute_update.password.get_secret_value()
query = update(models.Compute).\
where(models.Compute.compute_id == compute_id).\