From c849ec3c11a03eb67e931e918c62482f632d784e Mon Sep 17 00:00:00 2001 From: forest Date: Sat, 30 Jan 2021 15:27:24 -0600 Subject: [PATCH] add 25 cent buffer to affordable_vm_sizes logic for UX --- capsulflask/console.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/capsulflask/console.py b/capsulflask/console.py index ee36f98..b80779e 100644 --- a/capsulflask/console.py +++ b/capsulflask/console.py @@ -209,7 +209,10 @@ def create(): affordable_vm_sizes = dict() for key, vm_size in vm_sizes.items(): - if vm_size["dollars_per_month"] <= account_balance: + # if a user deposits $7.50 and then creates an f1-s vm which costs 7.50 a month, + # then they have to delete the vm and re-create it, they will not be able to, they will have to pay again. + # so for UX it makes a lot of sense to give a small margin of 25 cents for usability sake + if vm_size["dollars_per_month"] <= account_balance+0.25: affordable_vm_sizes[key] = vm_size for error in errors: