Skip to content
Snippets Groups Projects
Commit 4317022b authored by Megan Henning's avatar Megan Henning
Browse files

Fix job _id vs id_ switch

parent a03af80f
No related branches found
No related tags found
No related merge requests found
......@@ -27,8 +27,8 @@ class ContainerStorage(object):
return self._get_el(_id)
def exec_op(self, action, _id=None, payload=None, query=None, user=None,
public=False, projection=None, recursive=False, r_payload=None,
replace_metadata=False): # pylint: disable=unused-argument
public=False, projection=None, recursive=False, r_payload=None, # pylint: disable=unused-argument
replace_metadata=False):
"""
Generic method to exec an operation.
The request is dispatched to the corresponding private methods.
......
......@@ -107,6 +107,8 @@ def process_form(request, hash_alg=None):
return (form, tempdir)
def getHashingFieldStorage(upload_dir, hash_alg):
# pylint: disable=attribute-defined-outside-init
class HashingFieldStorage(cgi.FieldStorage):
bufsize = 2**20
......
......@@ -38,7 +38,7 @@ class Job(object):
The state of this job. Defaults to 'pending'.
request: map (optional)
The request that is used for the engine. Generated when job is started.
_id: string (optional)
id_: string (optional)
The database identifier for this job.
"""
......@@ -115,6 +115,8 @@ class Job(object):
# Don't modify the job obj
d = copy.deepcopy(self.__dict__)
d['id'] = d.pop('id_', None)
if d.get('inputs'):
for x in d['inputs'].keys():
d['inputs'][x] = d['inputs'][x].__dict__
......@@ -126,8 +128,8 @@ class Job(object):
else:
d.pop('destination')
if d['_id'] is None:
d.pop('_id')
if d['id'] is None:
d.pop('id')
if d['previous_job_id'] is None:
d.pop('previous_job_id')
if d['request'] is None:
......@@ -137,8 +139,8 @@ class Job(object):
def mongo(self):
d = self.map()
if d.get('_id'):
d['_id'] = bson.ObjectId(d['_id'])
if d.get('id'):
d['id'] = bson.ObjectId(d['id'])
if d.get('inputs'):
input_array = []
for k, inp in d['inputs'].iteritems():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment