Fix 807256: TypeError:list of indices must be integers, not unicode

This commit is contained in:
Charles Haley 2011-07-08 07:39:44 +01:00
parent dd62e49a87
commit 5174e5ca74
2 changed files with 3 additions and 4 deletions

View File

@ -446,9 +446,8 @@ class EditMetadataAction(InterfaceAction):
if d.result() == d.Accepted: if d.result() == d.Accepted:
to_rename = d.to_rename # dict of new text to old ids to_rename = d.to_rename # dict of new text to old ids
to_delete = d.to_delete # list of ids to_delete = d.to_delete # list of ids
for text in to_rename: for old_id, new_name in to_rename.iteritems():
for old_id in to_rename[text]: model.rename_collection(old_id, new_name=unicode(new_name))
model.rename_collection(old_id, new_name=unicode(text))
for item in to_delete: for item in to_delete:
model.delete_collection_using_id(item) model.delete_collection_using_id(item)
self.gui.upload_collections(model.db, view=view, oncard=oncard) self.gui.upload_collections(model.db, view=view, oncard=oncard)

View File

@ -218,7 +218,7 @@ class TagBrowserMixin(object): # {{{
d = TagListEditor(self, tag_to_match=tag, data=result, key=key) d = TagListEditor(self, tag_to_match=tag, data=result, key=key)
d.exec_() d.exec_()
if d.result() == d.Accepted: if d.result() == d.Accepted:
to_rename = d.to_rename # dict of new text to old id to_rename = d.to_rename # dict of old id to new name
to_delete = d.to_delete # list of ids to_delete = d.to_delete # list of ids
orig_name = d.original_names # dict of id: name orig_name = d.original_names # dict of id: name