diff --git a/instances/jobs.py b/instances/jobs.py index d3170397..565eda74 100644 --- a/instances/jobs.py +++ b/instances/jobs.py @@ -13,7 +13,7 @@ from libvirt import (VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE, VIR_DOMAIN_JOB_NONE, from vrtManager import util from vrtManager.connection import wvmConnect from vrtManager.create import wvmCreate -from vrtManager.instance import wvmInstance +from vrtManager.instance import check_snapshot_name, wvmInstance from accounts.models import UserInstance, UserSSHKey from appsettings.settings import app_settings @@ -305,6 +305,7 @@ class CreateSnapshot(Kind): "memory": bool(raw.get("memory")), "quiesce": bool(raw.get("quiesce"))} def validate(self, user, params): + check_snapshot_name(params["name"]) # recovery counts a listed snapshot as taken by the job if params["name"] in _proxy(_authorized(user, params["instance"])).instance.snapshotListNames(0): raise util.OperationError(f"A snapshot named {params['name']} already exists") diff --git a/instances/templates/instances/snapshots_tab.html b/instances/templates/instances/snapshots_tab.html index d21797a2..075c34bc 100755 --- a/instances/templates/instances/snapshots_tab.html +++ b/instances/templates/instances/snapshots_tab.html @@ -1,4 +1,6 @@ {% load i18n %} +{% load tz %} +{% get_current_timezone as TIME_ZONE %} {% load bootstrap_icons %} {% load operations %}