 _ = require('underscore')
 async = require('async')
-Q = require('q')
 Promise = require('bluebird')
 
 Indicator = require('../models/indicator').model


    res.redirect("/themes/#{theTheme.id}")

  ).fail((err) ->
    console.error err
    return res.render(500, "Error fetching the theme")
  )

exports.discardDraft = (req, res) ->
  theTheme = null

  themeFinder = Theme.findOne(_id: req.params.id).populate('owner')
  Promise.promisify(
    themeFinder.exec,
    themeFinder
  )().then( (theme) ->
    theTheme = theme

    unless theme?
