fix: use app instead of type for validating template

This commit is contained in:
fiftin 2024-04-19 22:24:46 +05:00
parent f93969f340
commit 7fdcf63f13
No known key found for this signature in database
GPG Key ID: 044381366A5D4731

View File

@ -84,8 +84,8 @@ type Template struct {
} }
func (tpl *Template) Validate() error { func (tpl *Template) Validate() error {
switch tpl.Type { switch tpl.App {
case TemplateTask, TemplateBuild, TemplateDeploy: case TemplateAnsible:
if tpl.InventoryID == nil { if tpl.InventoryID == nil {
return &ValidationError{"template inventory can not be empty"} return &ValidationError{"template inventory can not be empty"}
} }