Skip to content

Commit

Permalink
feat(VirtualMachineImage): Add public check to create new servers from
Browse files Browse the repository at this point in the history
  • Loading branch information
balamurali27 committed Jul 4, 2024
1 parent 3305c0c commit f61ae16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"platform",
"series",
"copied_from",
"public",
"credentials_section",
"mariadb_root_password"
],
Expand Down Expand Up @@ -121,11 +122,17 @@
"fieldtype": "Data",
"label": "Snapshot ID",
"read_only": 1
},
{
"default": "1",
"fieldname": "public",
"fieldtype": "Check",
"label": "Public"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-12-11 18:02:20.719052",
"modified": "2024-07-04 12:26:14.185070",
"modified_by": "Administrator",
"module": "Press",
"name": "Virtual Machine Image",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class VirtualMachineImage(Document):
instance_id: DF.Data
mariadb_root_password: DF.Password | None
platform: DF.Data | None
public: DF.Check
region: DF.Link
series: DF.Literal["n", "f", "m", "c", "p", "e", "r"]
size: DF.Int
Expand Down Expand Up @@ -170,6 +171,7 @@ def get_available_for_series(
frappe.qb.from_(images)
.select("name")
.where(images.status == "Available")
.where(images.public == 1)
.where(
images.series == series,
)
Expand Down

0 comments on commit f61ae16

Please sign in to comment.