Fixes #7038: No error when hostgroup name exceeds 245 characters

This PR replaces https://github.com/theforeman/foreman/pull/1686
Note you can't put interpolation inside an extracted string (use %s etc), and errors for attributes should begin with a lower case letter so they read correctly when concatenated.