Skip to content

Commit

Permalink
Profile passwords are not optional, and not required to delete profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dougherty committed Sep 26, 2012
1 parent 093117c commit f52839f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
9 changes: 1 addition & 8 deletions digsby/src/digsbysplash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 0 additions & 2 deletions digsby/src/gui/profiledialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions digsby/src/plugins/digsby_identity/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f52839f

Please sign in to comment.