|
21 | 21 |
|
22 | 22 | from ..auth.apikeys import JobApiKey |
23 | 23 |
|
24 | | -from .gears import validate_gear_config, get_gears, get_gear, get_invocation_schema, remove_gear, upsert_gear, suggest_container, get_gear_by_name, check_for_gear_insertion, fill_gear_default_values |
| 24 | +from .gears import validate_gear_config, get_gears, get_gear, get_invocation_schema, remove_gear, upsert_gear, suggest_container, get_gear_by_name, check_for_gear_insertion |
25 | 25 | from .jobs import Job, Logs |
26 | 26 | from .batch import check_state, update |
27 | 27 | from .queue import Queue |
@@ -183,8 +183,7 @@ def post(self, cid): |
183 | 183 |
|
184 | 184 | doc['project_id'] = cid |
185 | 185 |
|
186 | | - if 'config' in doc: |
187 | | - validate_gear_config(gear, fill_gear_default_values(gear, doc['config'])) |
| 186 | + validate_gear_config(gear, doc.get('config')) |
188 | 187 |
|
189 | 188 | result = config.db.project_rules.insert_one(doc) |
190 | 189 | return { '_id': result.inserted_id } |
@@ -239,8 +238,7 @@ def put(self, cid, rid): |
239 | 238 |
|
240 | 239 | if 'alg' in updates or 'config' in updates: |
241 | 240 | gear = get_gear_by_name(updates.get('alg', doc['alg'])) |
242 | | - config_ = fill_gear_default_values(gear, updates.get('config', doc.get('config', {}))) |
243 | | - validate_gear_config(gear, config_) |
| 241 | + validate_gear_config(gear, updates.get('config', doc.get('config'))) |
244 | 242 |
|
245 | 243 | doc.update(updates) |
246 | 244 | config.db.project_rules.replace_one({'_id': bson.ObjectId(rid)}, doc) |
@@ -539,7 +537,7 @@ def post(self): |
539 | 537 | gear = get_gear(gear_id) |
540 | 538 | if gear.get('gear', {}).get('custom', {}).get('flywheel', {}).get('invalid', False): |
541 | 539 | self.abort(400, 'Gear marked as invalid, will not run!') |
542 | | - validate_gear_config(gear, fill_gear_default_values(gear, config_)) |
| 540 | + validate_gear_config(gear, config_) |
543 | 541 |
|
544 | 542 | container_ids = [] |
545 | 543 | container_type = None |
|
0 commit comments