Skip to content

Commit

Permalink
webadmin: Fix creating of a new template
Browse files Browse the repository at this point in the history
When creating a new template, the initTemplate() method
is called after the list of base templates is loaded.
However, if there are no templates other than the Blank
template, the list is not loaded and the initTemplate()
method is never called. As a result, the builders from
VM to UnitVmModel are never called and the UnitVmModel
is not initialized properly. The attempt to create a new
template fails.

This patch calls the initTemplate() method also for the cases
when there are no base templates available and the Blank template
is the only template present.
  • Loading branch information
ljelinkova authored and mrkev-gh committed May 10, 2022
1 parent 2b75893 commit 1aa211a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private void postInitBaseTemplate(List<VmTemplate> templates) {
// it is not allowed to create sub-templates of Blank template
getModel().getIsSubTemplate().setIsChangeable(false,
constants.someNonDefaultTemplateHasToExistFirst());
initTemplate();
return;
}

Expand Down

0 comments on commit 1aa211a

Please sign in to comment.