diff --git a/lib/machines.js b/lib/machines.js index 829a786f..e373c31f 100644 --- a/lib/machines.js +++ b/lib/machines.js @@ -484,6 +484,7 @@ function getProject (projectId, create) { update: '', logs: '' }, + traits: ['c9sdk'], data: {} }; projects[projectId] = project; diff --git a/lib/users.js b/lib/users.js index 92972574..e58b7b69 100644 --- a/lib/users.js +++ b/lib/users.js @@ -288,6 +288,18 @@ function getOrCreateUser (email) { if (!machine.project) { machine.project = projectId; } + + // Temporary migration code: Previous machines didn't have traits. + if (!machine.traits) { + const updated = new Date(machine.data.updated); + const c9sdkStart = new Date('2017-08-02'); + + machine.traits = []; + + if (updated > c9sdkStart) { + machine.traits.push('c9sdk'); + } + } } } diff --git a/templates/contributions.html b/templates/contributions.html index 4c1a08d0..f99f64e8 100644 --- a/templates/contributions.html +++ b/templates/contributions.html @@ -29,9 +29,8 @@