 Channel = require('../model/channels').Channel
 Transaction = require('../model/transactions').Transaction
+ObjectId = require('mongoose').Types.ObjectId
 Q = require 'q'
 logger = require 'winston'
 authorisation = require './authorisation'

    this.status = 201
    logger.info 'User %s created channel with id %s', this.authenticated.email, channel.id

    processPostAddTriggers channelData
  catch err
    # Error! So inform the user

    this.body = 'The channel was successfully updated'
    logger.info 'User %s updated channel with id %s', this.authenticated.email, id

    channelData._id = ObjectId id
    processPostUpdateTriggers channelData
  catch err
    # Error! So inform the user
