     key:         req.body.key
     displayName: req.body.displayName
   user = req.user
+
+  unless util.validate queue.key
+    res.status(500).send 'Invalid key for queue'
 
   models.Queue.create queue
     .then (queue) ->


  # this is kind of an unfortunate query, but I'm not good enought at SQL nor
  # sequelize to be able to join all the queues and their lengths
  models.Queue.findAll include: includeParams
    .then (queues) ->
      res.json queues


models = require '../models'
util   = require '../public/src/util'

includeParams = [
    model: models.Spot
