Skip to content

Commit

Permalink
Don't count presenters and moderators in attendee count during autore…
Browse files Browse the repository at this point in the history
…gistration
  • Loading branch information
petschekr committed Apr 17, 2016
1 parent 07c2c40 commit e8540ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions World Perspectives/routes/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,11 +1453,14 @@ router.route("/registration/auto").post(function (request, response) {
})
]).spread(function (presenting: any[], moderating: any[]) {
var registerSlug = null;
var attendanceCount = 1;
if (presenting.length > 0) {
registerSlug = presenting[0].slug;
attendanceCount = 0;
}
else if (moderating.length > 0) {
registerSlug = moderating[0].slug;
attendanceCount = 0;
}
else {
registerSlug = availableSessions[0].slug;
Expand All @@ -1469,10 +1472,11 @@ router.route("/registration/auto").post(function (request, response) {
MATCH (user:User {username: {username}})
MATCH (session:Session {slug: {slug}})
CREATE (user)-[r:ATTENDS]->(session)
SET session.attendees = session.attendees + 1`,
SET session.attendees = session.attendees + {attendanceCount}`,
params: {
username: user.username,
slug: registerSlug
slug: registerSlug,
attendanceCount: attendanceCount
}
});
});
Expand Down

0 comments on commit e8540ab

Please sign in to comment.