Skip to content

Commit

Permalink
Merge pull request #429 from roy-zahor/gate_system
Browse files Browse the repository at this point in the history
Fixing quota issue
  • Loading branch information
roy-zahor authored May 20, 2017
2 parents 8feb227 + 576b91f commit 49fe635
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ else {

switch (process.env.SPARK_DB_CLIENT || "mysql") {
case "mysql":
console.log("Spark config: Using MySQL database", process.env.SPARK_DB_HOSTNAME || "localhost");
console.log("Spark config: Using MySQL database",
process.env.SPARK_DB_HOSTNAME || "localhost", "/",
process.env.SPARK_DB_DBNAME || "spark");
exports.database = {
"client": process.env.SPARK_DB_CLIENT || "mysql",
"host": process.env.SPARK_DB_HOSTNAME || "localhost",
Expand Down
3 changes: 2 additions & 1 deletion models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ var UsersGroup = bookshelf.Model.extend({
});
},
quotaReached: async function () {
return (await this.usersInsideEventsCounter >= this.attributes.entrance_quota);
let inside = await this.usersInsideEventsCounter;
return (inside >= this.attributes.entrance_quota);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion routes/api_gate_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ router.post('/gate-enter', async function (req, res) {
return sendError(res, 500, "ALREADY_INSIDE");
}

if (req.body.force) {
if (req.body.force === "true") {
log.warn('Forced ticket entrance', ticket.attributes.ticket_number);
ticket.attributes.forced_entrance = true;
ticket.attributes.forced_entrance_reason = req.body.force_reason;
Expand Down

0 comments on commit 49fe635

Please sign in to comment.