Fixed a condition that was raising a traceback when adding an audio attachment

This commit is contained in:
2018-12-20 16:05:20 -06:00
parent ba14699dfb
commit ca3873f055
2 changed files with 8 additions and 5 deletions

View File

@@ -130,11 +130,14 @@ class selectAttachment(widgetUtils.BaseDialog):
if selection in self.attachments_list:
self.attachments.Append(selection)
self.indexes.append(self.cb.GetSelection())
self.remove.Enable(True)
def remove_attachment(self, *args, **kwargs):
n = self.attachments.GetSelection()
self.attachments.Delete(n)
self.indexes.remove(n)
self.indexes.pop(n)
if len(self.indexes) == 0:
self.remove.Enable(False)
def get_all_attachments(self):
return self.indexes