module.exports = function(req, res, next) {

  User.count().then(count => {
    if (count === 0) {
      Role.create({name: "admin"})
      .then( role => {
        return User.create({
          username: "admin",
          email: "michael.gaeta@af83.com",
          password: "passpass",
          role: role.id
        })
      })
      .then( user => { next(); })
    } else
      next()
  })

};
@@ -37,17 +37,16 @@
 next) %7B%0A
-%0A
   User.c
@@ -56,18 +56,25 @@
 t().
-then(
+exec((err, 
 count
+)
  =%3E 
@@ -136,26 +136,25 @@
 n%22%7D)
-%0A      .then(
+.exec((err,
  role
+)
  =%3E 
@@ -167,15 +167,8 @@
     
-return 
 User
@@ -333,66 +333,24 @@
     
-  .then( user =%3E %7B next(); %7D)%0A    %7D else%0A      next()%0A  %7D)%0A
+%7D%0A  %7D)%0A  next();
 %0A%7D;
+%0A

fix warnings for policies first install