From 3c4b91728053e242eb13a04a3c13074033c493f5 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Tue, 18 Jun 2024 12:43:46 +0200 Subject: 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. --- ogcp/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogcp/views.py b/ogcp/views.py index d022d04..abcc0a7 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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')) -- cgit v1.2.3-18-g5258