From e8540abbbbe1e97245a336720a7d30a2118e680e Mon Sep 17 00:00:00 2001 From: Ryan Petschek Date: Sun, 17 Apr 2016 01:20:47 -0400 Subject: [PATCH] Don't count presenters and moderators in attendee count during autoregistration --- World Perspectives/routes/admin.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/World Perspectives/routes/admin.ts b/World Perspectives/routes/admin.ts index d5733b9..edac0ca 100644 --- a/World Perspectives/routes/admin.ts +++ b/World Perspectives/routes/admin.ts @@ -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; @@ -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 } }); });