From f52839ff304d9ea2c691247f55784578b3a43fc9 Mon Sep 17 00:00:00 2001 From: Mike Dougherty Date: Tue, 25 Sep 2012 13:32:32 -0700 Subject: [PATCH] Profile passwords are not optional, and not required to delete profiles. --- digsby/src/digsbysplash.py | 9 +-------- digsby/src/gui/profiledialog.py | 2 -- digsby/src/plugins/digsby_identity/identity.py | 7 ++----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/digsby/src/digsbysplash.py b/digsby/src/digsbysplash.py index 530a380..fcaf746 100644 --- a/digsby/src/digsbysplash.py +++ b/digsby/src/digsbysplash.py @@ -380,20 +380,13 @@ def OnChoice(self, evt): identity_obj.password = self.window.GetPassword() - if not (self.window.GetPassword() or identity_obj.is_valid): - evt.EventObject.SetSelection(last_choice) - wx.MessageBox( - _('Please enter the profile\'s password before removing it.'), - _('Remove Profile')) - return - if wx.OK == wx.MessageBox( _('Are you sure you want to delete profile "%s"?' % username), _('Remove Profile'), wx.OK | wx.CANCEL): import digsby.digsbylocal as digsbylocal try: - hooks.first('digsby.identity.delete', username, self.window.GetPassword(), + hooks.first('digsby.identity.delete', username, raise_hook_exceptions=True) except digsbylocal.InvalidPassword: wx.MessageBox(_('Please enter the correct password to delete "%s".' % username), diff --git a/digsby/src/gui/profiledialog.py b/digsby/src/gui/profiledialog.py index beeb7e7..fa017aa 100644 --- a/digsby/src/gui/profiledialog.py +++ b/digsby/src/gui/profiledialog.py @@ -85,14 +85,12 @@ def __init__(self, parent, validator = None): s = wx.BoxSizer(wx.HORIZONTAL) s.Add(profile_password, 1, ALIGN_LEFT | ALIGN_CENTER_VERTICAL | EXPAND) - s.Add(TEXT(_('(optional)')), 0, ALIGN_LEFT | ALIGN_CENTER_VERTICAL | EXPAND | wx.LEFT | wx.TOP, 5) aus.Add(s, 1, ALIGN_LEFT | ALIGN_CENTER_VERTICAL | EXPAND | ALL, 2) aus.Add(TEXT(_("&Re-Enter Password:")), 0, ALIGN_RIGHT | ALIGN_CENTER_VERTICAL | ALL, 2) s = wx.BoxSizer(wx.HORIZONTAL) s.Add(reenter_password, 1, ALIGN_LEFT | ALIGN_CENTER_VERTICAL | EXPAND) - s.Add(TEXT(_('(optional)')), 0, ALIGN_LEFT | ALIGN_CENTER_VERTICAL | EXPAND | wx.LEFT | wx.TOP, 5) aus.Add(s, 1, ALIGN_LEFT | ALIGN_CENTER_VERTICAL | EXPAND | ALL, 2) aus.AddGrowableCol(1, 1) diff --git a/digsby/src/plugins/digsby_identity/identity.py b/digsby/src/plugins/digsby_identity/identity.py index da280eb..d44dfb5 100644 --- a/digsby/src/plugins/digsby_identity/identity.py +++ b/digsby/src/plugins/digsby_identity/identity.py @@ -54,16 +54,13 @@ def load_data(cls, key, default = None): return active.get(key, default) @classmethod - def delete(cls, name, password): + def delete(cls, name): if not cls.exists(name): # TODO: should this just cleanly return? # the expected post-conditions of this function are satisfied... raise digsbylocal.InvalidUsername - identity = cls(name, password) - if not identity.is_valid: - raise digsbylocal.InvalidPassword - + identity = cls(name) identity.storage.rmtree() @classmethod