views: ignore image datasize check if datasize is zero

Check the restored image fits in the target partition only if
the datasize value is not zero. Proceed with the check before
the image/restore request otherwise.
master
Alejandro Sirgo Rica 2024-06-18 12:43:46 +02:00
parent e9a9ec467e
commit 3c4b917280
1 changed files with 1 additions and 1 deletions

View File

@ -781,7 +781,7 @@ def action_image_restore():
image_datasize = int(image['datasize'])
part_size = int(part_size) * 1024
if image_datasize > part_size:
if image_datasize and image_datasize > part_size:
flash(_(f'The image size is bigger than the target partition'), category='error')
return redirect(url_for('commands'))