mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 11:38:24 +00:00
add profile.name in migration, ui-router in production grunt
This commit is contained in:
parent
2cd4bbb0ec
commit
8b76b74d78
2 changed files with 10 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ module.exports = function(grunt) {
|
|||
'public/bower_components/angular/angular.min.js',
|
||||
'public/bower_components/angular-sanitize/angular-sanitize.min.js',
|
||||
'public/bower_components/marked/lib/marked.js',
|
||||
'public/bower_components/angular-route/angular-route.min.js',
|
||||
'public/bower_components/angular-ui-router/angular-ui-router.min.js',
|
||||
'public/bower_components/angular-resource/angular-resource.min.js',
|
||||
'public/bower_components/angular-ui/build/angular-ui.min.js',
|
||||
'public/bower_components/angular-ui-utils/modules/keypress/keypress.js',
|
||||
|
|
|
|||
|
|
@ -24,6 +24,15 @@ db.users.find().forEach(function(user){
|
|||
});
|
||||
});
|
||||
|
||||
// Add username
|
||||
if (_.isEmpty(user.profile.name)) {
|
||||
var fb = user.auth.facebook;
|
||||
user.profile.name =
|
||||
(user.auth.local && user.auth.local.username) ||
|
||||
(fb && (fb.displayName || fb.name || fb.username || (fb.first_name && fb.first_name + ' ' + fb.last_name))) ||
|
||||
'Anonymous';
|
||||
}
|
||||
|
||||
// Migrate to TaskSchema subdocs!!
|
||||
if (!user.tasks) {
|
||||
// FIXME before deploying!
|
||||
|
|
|
|||
Loading…
Reference in a new issue