Skip to content

Commit 4a79a35

Browse files
committed
Add update description step to repository migration.
1 parent f98b195 commit 4a79a35

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

opengever/maintenance/scripts/repository_migration_analyse.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def run(self):
294294
self.move_branches(self.items_to_move())
295295
self.adjust_reference_number_prefix(self.items_to_adjust_number())
296296
self.rename(self.items_to_rename())
297+
self.update_description(self.operations_list)
297298
self.reindex()
298299
self.validate()
299300

@@ -400,14 +401,25 @@ def rename(self, items):
400401
# Adjust id if necessary
401402
ObjectIDUpdater(repo, FakeOptions()).maybe_update_id()
402403

404+
def update_description(self, items):
405+
for item in items:
406+
repo = uuidToObject(item['uid'])
407+
if not repo:
408+
continue
409+
410+
new_description = item['new_item']['description']
411+
if repo.description != new_description:
412+
repo.description = new_description
413+
403414
def reindex(self):
404415
for item in self.operations_list:
405416
obj = uuidToObject(item['uid'])
406417
if not obj:
407418
# New created objects can be ignored
408419
break
409420

410-
obj.reindexObject(idxs=['Title', 'sortable_title', 'path', 'reference'])
421+
obj.reindexObject(idxs=['Title', 'sortable_title', 'path',
422+
'reference', 'Description'])
411423

412424
class FakeOptions(object):
413425
dry_run = False

0 commit comments

Comments
 (0)