If new host group name is wrong, template added to all existing host groups and not seeing error message about group name
Steps to reproduce:
1. Go to Configuration->Templates->Create template
2. write correct template name
3. write incorrect new group name, for example existing host group name 'Zabbix servers'
4. Add template
Actual result: template created and added to all existing host groups. If press 'Details' in success message, you will see message that "Host group "Zabbix servers" already exists."
Expected result: template not created, displaying error message "Host group "Zabbix servers" already exists."
Affects all versions starting from 3.0.0, in 2.2 ok