Mongoose 5 (#9870)

* mongoose 5: remove unused autoinc, remove promise option (it uses native promises now)

* remove mongodb package

* remove mongoskin

* migrate migration away from mongoskin

* fix mongoose hooks

* fix _updateUserWithRetries

* try without next

* remove init

* update sinon

* fix some integration tests

* fix remaining tests

* fix error message

* fix error message

* fix error message

* another fix

* fix mongoose options

* remove greenkeeper exception
This commit is contained in:
Matteo Pagliazzi
2018-03-09 13:13:58 -08:00
committed by Sabe Jones
parent f9a47b1420
commit 1332fd68b0
6 changed files with 3506 additions and 2190 deletions

View File

@@ -50,7 +50,7 @@ schema.plugin(baseModel, {
timestamps: true,
});
schema.pre('init', function ensureSummaryIsFetched (next, chal) {
schema.pre('init', function ensureSummaryIsFetched (chal) {
// The Vue website makes the summary be mandatory for all new challenges, but the
// Angular website did not, and the API does not yet for backwards-compatibilty.
// When any challenge without a summary is fetched from the database, this code
@@ -59,7 +59,6 @@ schema.pre('init', function ensureSummaryIsFetched (next, chal) {
if (!chal.summary) {
chal.summary = chal.name ? chal.name.substring(0, MAX_SUMMARY_SIZE_FOR_CHALLENGES) : ' ';
}
next();
});
// A list of additional fields that cannot be updated (but can be set on creation)