summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-18 12:43:46 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-18 12:43:46 +0200
commit3c4b91728053e242eb13a04a3c13074033c493f5 (patch)
treec26bb367bf07cfb1e6859d3912c527404463ec39 /ogcp
parente9a9ec467ead7bcc56bbb3e19ec2a17d5a3737d0 (diff)
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.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py2
1 files changed, 1 insertions, 1 deletions
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'))