Skip to content

Commit

Permalink
Add group id to upserted session
Browse files Browse the repository at this point in the history
  • Loading branch information
kofalt committed Mar 4, 2016
1 parent 3ad7566 commit 4fdbb93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4fdbb93

Please sign in to comment.