Bytes from int to str

This commit is contained in:
inexcode 2022-07-25 17:17:57 +03:00
parent 5532114668
commit a6fe72608f

View file

@ -7,9 +7,9 @@ from selfprivacy_api.utils.block_devices import BlockDevices
@strawberry.type @strawberry.type
class StorageVolume: class StorageVolume:
total_space: int total_space: str
free_space: int free_space: str
used_space: int used_space: str
root: bool root: bool
name: str name: str
@ -21,9 +21,9 @@ class Storage:
"""Get list of volumes""" """Get list of volumes"""
return [ return [
StorageVolume( StorageVolume(
total_space=volume.fssize if volume.fssize is not None else volume.size, total_space=str(volume.fssize) if volume.fssize is not None else str(volume.size),
free_space=volume.fsavail, free_space=str(volume.fsavail),
used_space=volume.fsused, used_space=str(volume.fsused),
root=volume.name == "sda1", root=volume.name == "sda1",
name=volume.name, name=volume.name,
) )