fix: claim_ownerless actually claims ownerless documents (was a no-op self-update) (#1288)
This commit is contained in:
parent
c39d8db12a
commit
8852c7ea4a
1 changed files with 6 additions and 4 deletions
|
|
@ -58,10 +58,12 @@ def main():
|
|||
count = db.query(Session).filter(Session.owner == None).update({"owner": owner})
|
||||
print(f" sessions: claimed {count}")
|
||||
|
||||
# Documents
|
||||
count = db.query(Document).filter(Document.session_id.in_(
|
||||
db.query(Session.id).filter(Session.owner == owner)
|
||||
)).update({"session_id": Document.session_id}, synchronize_session=False)
|
||||
# Documents (have their own owner column; claim the ownerless ones,
|
||||
# mirroring the sessions/gallery/comparisons blocks). The old query set
|
||||
# session_id to itself — a no-op — and never set owner, so ownerless
|
||||
# documents stayed ownerless and invisible in the user's Library.
|
||||
count = db.query(Document).filter(Document.owner == None).update({"owner": owner})
|
||||
print(f" documents: claimed {count}")
|
||||
|
||||
# Gallery
|
||||
if GalleryImage:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue