mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
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:
committed by
Sabe Jones
parent
f9a47b1420
commit
1332fd68b0
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user