Skip to content

Commit

Permalink
reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
rv0lt committed Dec 9, 2024
1 parent 21103c2 commit 2165eef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dds_web/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def create_new_unit(
return

# The quota input is in TB, convert to bytes
quota_bytes = quota * 1000**4
quota_bytes = int(quota * 1000**4)

new_unit = models.Unit(
name=name,
Expand Down Expand Up @@ -227,8 +227,8 @@ def update_unit_quota(unit_id, quota):

# ask the user for confirmation
do_update = rich.prompt.Confirm.ask(
f"Current quota for unit '{unit_id}' is {round(unit.quota / 1000 ** 4, 2)} TB. \n"
f"You are about to update the quota to {quota} TB ({quota * 1000 ** 3} GB.) \n"
f"Current quota for unit '{unit_id}' is {round(unit.quota / 1000 ** 4, 2)} TB ({round(unit.quota / 1000 ** 3,2)} GB). \n"
f"You are about to update the quota to {quota} TB ({quota * 1000 ** 3} GB). \n"
"Are you sure you want to continue?"
)
if not do_update:
Expand All @@ -238,7 +238,7 @@ def update_unit_quota(unit_id, quota):
return

# Set sto4 info
quota_bytes = quota * 1000**4
quota_bytes = int(quota * 1000**4)
unit.quota = quota_bytes
db.session.commit()

Expand Down

0 comments on commit 2165eef

Please sign in to comment.