mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
in locals middleware require tavern and mods only once
This commit is contained in:
@@ -577,6 +577,10 @@ UserSchema.methods.unlink = function(options, cb) {
|
||||
|
||||
module.exports.schema = UserSchema;
|
||||
module.exports.model = mongoose.model("User", UserSchema);
|
||||
// Initially export an empty object so external requires will get
|
||||
// the right object by reference when it's defined later
|
||||
// Otherwise it would remain undefined if requested before the query executes
|
||||
module.exports.mods = {};
|
||||
|
||||
mongoose.model("User")
|
||||
.find({'contributor.admin':true})
|
||||
|
||||
Reference in New Issue
Block a user