mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
whitespaces are removed from mongo_id string and tested converting to ObjectId
This commit is contained in:
parent
df4f5b8b41
commit
83660c78de
1 changed files with 5 additions and 0 deletions
|
|
@ -177,6 +177,11 @@ def import_to_avalon(
|
|||
return output
|
||||
|
||||
mongo_id = entity['custom_attributes'][ca_mongoid]
|
||||
mongo_id = mongo_id.replace(' ', '').replace('\n', '')
|
||||
try:
|
||||
ObjectId(mongo_id)
|
||||
except Exception:
|
||||
mongo_id = ''
|
||||
|
||||
if mongo_id is not '':
|
||||
avalon_asset = database[project_name].find_one(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue