mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
fix: revert duplicate image check to fix failing tests
This commit is contained in:
parent
1e40fa1b70
commit
03b3078271
@ -47,16 +47,8 @@ class ImagesRepository(BaseRepository):
|
||||
where(models.Image.filename == image_name, models.Image.path.endswith(image_path))
|
||||
else:
|
||||
query = select(models.Image).where(models.Image.filename == image_name)
|
||||
query = query.order_by(models.Image.image_id)
|
||||
result = await self._db_session.execute(query)
|
||||
images = result.scalars().all()
|
||||
if len(images) > 1:
|
||||
log.warning(
|
||||
f"Multiple DB entries found for image '{image_path}' "
|
||||
f"({len(images)} rows). This indicates a data integrity issue. "
|
||||
f"Using the entry with the lowest image_id ({images[0].image_id})."
|
||||
)
|
||||
return images[0] if images else None
|
||||
return result.scalars().one_or_none()
|
||||
|
||||
async def get_image_by_checksum(self, checksum: str, image_dir: str = None) -> Optional[models.Image]:
|
||||
"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user