mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merged in bugfix/integriti_error_project_struct (pull request #390)
bugfix/integrity_error_fix Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
18ff4f4e9d
1 changed files with 7 additions and 0 deletions
|
|
@ -142,6 +142,13 @@ class CreateProjectFolders(BaseAction):
|
|||
else:
|
||||
data['project_id'] = parent['project']['id']
|
||||
|
||||
existing_entity = self.session.query((
|
||||
"TypedContext where name is \"{}\" and "
|
||||
"parent_id is \"{}\" and project_id is \"{}\""
|
||||
).format(name, data['parent_id'], data['project_id'])).first()
|
||||
if existing_entity:
|
||||
return existing_entity
|
||||
|
||||
new_ent = self.session.create(ent_type, data)
|
||||
self.session.commit()
|
||||
return new_ent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue