From 4fdbb93401b5d3c87cb6e0d7373c23a629d1740b Mon Sep 17 00:00:00 2001 From: Nathaniel Kofalt Date: Fri, 4 Mar 2016 12:44:36 -0600 Subject: [PATCH] Add group id to upserted session --- api/placer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/placer.py b/api/placer.py index 6c1b322d2..6e68ded55 100644 --- a/api/placer.py +++ b/api/placer.py @@ -166,9 +166,10 @@ def check(self): self.s_label = self.metadata['session']['label'] self.a_label = self.metadata['acquisition']['label'] - # Get project permissions + # Get project info that we need later project = config.db['projects'].find_one({ '_id': bson.ObjectId(self.p_id)}) self.permissions = project.get('permissions', {}) + self.g_id = project['group'] # If a timestamp was provided, use that for zip files. Otherwise use a set date. # Normally we'd use epoch, but zips cannot support years older than 1980, so let's use that instead. @@ -239,7 +240,8 @@ def finalize(self): # Get or create a session based on the hierarchy and provided labels. s = { 'project': bson.ObjectId(self.p_id), - 'label': self.s_label + 'label': self.s_label, + 'group': self.g_id } # self.permissions