       { template, templateDetails, rawContent } = data
 
       if template?
+
+        if validationError = validateTemplate template, group
+          return callback validationError
+
         data.template = generateTemplateObject \
           template, rawContent, templateDetails
 


      unless data?.title
        return callback new KodingError 'Title required.'

      stackTemplate = new JStackTemplate
        originId    : delegate.getId()

    }


  validateTemplate = (template, group) ->

    plan = group.getAt 'config.plan'
    return  unless plan # No plan, no pain.

    ComputeProvider = require './computeprovider'
    return ComputeProvider.validateTemplateContent template, plan


  @create = permit 'create stack template',

    success: revive
