mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
assets without published content are removed from mongo
This commit is contained in:
parent
0f40eb699d
commit
5a9b45f484
1 changed files with 10 additions and 5 deletions
|
|
@ -12,7 +12,7 @@ from .constants import (
|
|||
REMOVED_ROLE
|
||||
)
|
||||
from .style import ResourceCache
|
||||
from pymongo import UpdateOne
|
||||
from pymongo import UpdateOne, DeleteOne
|
||||
from avalon.vendor import qtawesome
|
||||
from Qt import QtCore, QtGui
|
||||
|
||||
|
|
@ -1133,10 +1133,15 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
insert_list.append(item)
|
||||
|
||||
elif item.data(REMOVED_ROLE):
|
||||
bulk_writes.append(UpdateOne(
|
||||
{"_id": item.asset_id},
|
||||
{"$set": {"type": "archived_asset"}}
|
||||
))
|
||||
if item.data(HIERARCHY_CHANGE_ABLE_ROLE):
|
||||
bulk_writes.append(DeleteOne(
|
||||
{"_id": item.asset_id}
|
||||
))
|
||||
else:
|
||||
bulk_writes.append(UpdateOne(
|
||||
{"_id": item.asset_id},
|
||||
{"$set": {"type": "archived_asset"}}
|
||||
))
|
||||
|
||||
else:
|
||||
update_data = item.update_data()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue