Add users.isActivated

it's easier to see where we do activation checks
This commit is contained in:
Girish Ramakrishnan
2018-11-10 18:08:08 -08:00
parent 0c5cb9c98f
commit bd2b03876b
5 changed files with 35 additions and 14 deletions

View File

@@ -93,9 +93,9 @@ function onActivated(callback) {
// Starting the platform after a user is available means:
// 1. mail bounces can now be sent to the cloudron owner
// 2. the restore code path can run without sudo (since mail/ is non-root)
users.count(function (error, count) {
users.isActivated(function (error, activated) {
if (error) return callback(new CloudronError(CloudronError.INTERNAL_ERROR, error));
if (!count) return callback(); // not activated
if (!activated) return callback(); // not activated
async.series([
platform.start,