From d460f445287037708d6962fff4082704164850e9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 31 Jan 1999 18:00:43 +0000 Subject: Handle user deletion properly. svn path=/trunk/; revision=2366 --- fetchmailconf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fetchmailconf b/fetchmailconf index 5f210bd4..b49fc7b0 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -167,7 +167,7 @@ class Server: def __delitem__(self, name): for ui in range(len(self.users)): - if self.users[ui].pollname == name: + if self.users[ui].remote == name: del self.users[ui] break @@ -624,7 +624,8 @@ class ConfigurationEdit(Frame, MyWidget): self.subwidgets[sitename] = ServerEdit(sitename, self).edit(self.mode, Toplevel()) def server_delete(self, sitename): - del self.configuration[sitename] + if self.configuration.has_keys(sitename): + del self.configuration[sitename] def edit(self, mode): self.mode = mode @@ -911,7 +912,9 @@ class ServerEdit(Frame, MyWidget): self.subwidgets[username] = UserEdit(username, self).edit(mode, Toplevel()) def user_delete(self, username): - del self.subwidgets[username] + if self.subwidgets.has_key(username): + del self.subwidgets[username] + del self.server[username] def makeWidgets(self, host, mode): topwin = dispose_window(self, "Server options for querying " + host, serverhelp) -- cgit v1.2.3