Merge lp:~salgado/launchpad/bug-532669 into lp:launchpad

Proposed by Guilherme Salgado
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/bug-532669
Merge into: lp:launchpad
Diff against target: 112 lines (+3/-42)
3 files modified
lib/lp/registry/browser/person.py (+2/-17)
lib/lp/registry/stories/person/xx-deactivate-account.txt (+1/-20)
lib/lp/registry/templates/person-deactivate-account.pt (+0/-5)
To merge this branch: bzr merge lp:~salgado/launchpad/bug-532669
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+21443@code.launchpad.net

Description of the change

Remove the password field from +deactivate-account as soon enough we
won't even have access to the account's password, not to mention that it
wouldn't make any sense as the account password is the OpenID provider's
business and we're just a consumer.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/templates/person-deactivate-account.pt
  lib/lp/registry/stories/person/xx-deactivate-account.txt
  lib/lp/registry/browser/person.py

== Pylint notices ==

lib/lp/registry/browser/person.py
    117: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
    118: [F0401] Unable to import 'lazr.config' (No module named config)
    119: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
    120: [F0401] Unable to import 'lazr.restful.interfaces' (No module named restful)
    230: [F0401] Unable to import 'lazr.uri' (No module named uri)

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/person.py'
2--- lib/lp/registry/browser/person.py 2010-03-13 00:32:40 +0000
3+++ lib/lp/registry/browser/person.py 2010-03-16 13:03:31 +0000
4@@ -1,7 +1,7 @@
5 # Copyright 2009 Canonical Ltd. This software is licensed under the
6 # GNU Affero General Public License version 3 (see the file LICENSE).
7
8-# pylint: disable-msg=E0211,E0213
9+# pylint: disable-msg=E0211,E0213,C0322
10
11 """Person-related view classes."""
12
13@@ -116,7 +116,7 @@
14 from canonical.config import config
15 from lazr.delegates import delegates
16 from lazr.config import as_timedelta
17-from lazr.restful.interface import copy_field, use_template
18+from lazr.restful.interface import copy_field
19 from lazr.restful.interfaces import IWebServiceClientRequest
20 from canonical.lazr.utils import safe_hasattr
21 from canonical.database.sqlbase import flush_database_updates
22@@ -221,7 +221,6 @@
23 from canonical.launchpad.webapp.authorization import check_permission
24 from canonical.launchpad.webapp.batching import BatchNavigator
25 from canonical.launchpad.webapp.breadcrumb import Breadcrumb
26-from canonical.launchpad.webapp.interfaces import IPlacelessLoginSource
27 from canonical.launchpad.webapp.login import (
28 logoutPerson, allowUnauthenticatedSession)
29 from canonical.launchpad.webapp.menu import get_current_view
30@@ -1404,7 +1403,6 @@
31
32
33 class DeactivateAccountSchema(Interface):
34- use_template(IPerson, include=['password'])
35 comment = copy_field(
36 IPerson['account_status_comment'], readonly=False, __name__='comment')
37
38@@ -1415,19 +1413,6 @@
39 label = "Deactivate your Launchpad account"
40 custom_widget('comment', TextAreaWidget, height=5, width=60)
41
42- def validate(self, data):
43- loginsource = getUtility(IPlacelessLoginSource)
44- principal = loginsource.getPrincipalByLogin(
45- self.user.preferredemail.email)
46- assert principal is not None, "User must be logged in at this point."
47- # The widget will transform '' into a special marker value.
48- password = data.get('password')
49- if password is self.schema['password'].UNCHANGED_PASSWORD:
50- password = u''
51- if not principal.validate(password):
52- self.setFieldError('password', 'Incorrect password.')
53- return
54-
55 @action(_("Deactivate My Account"), name="deactivate")
56 def deactivate_action(self, action, data):
57 self.context.deactivateAccount(data['comment'])
58
59=== modified file 'lib/lp/registry/stories/person/xx-deactivate-account.txt'
60--- lib/lp/registry/stories/person/xx-deactivate-account.txt 2010-02-05 13:25:46 +0000
61+++ lib/lp/registry/stories/person/xx-deactivate-account.txt 2010-03-16 13:03:31 +0000
62@@ -1,7 +1,7 @@
63 = Deactivating user accounts =
64
65 Users who don't want to use Launchpad anymore can easily deactivate their
66-accounts, so they stop receiving emails from Launchpad and make it impossible
67+accounts so they stop receiving emails from Launchpad and make it impossible
68 to use their accounts to log in.
69
70 Deactivating a user's account will un-assign all their bug tasks. To
71@@ -35,25 +35,6 @@
72 >>> browser.url
73 'http://launchpad.dev/~name12/+deactivate-account'
74
75-To deactivate a user's account we require the user to enter his password.
76-
77- >>> browser.getControl('Why are you deactivating your account?').value = (
78- ... "I'm going to become a Budhist monk in Tibet")
79- >>> browser.getControl('Deactivate My Account').click()
80- >>> for msg in get_feedback_messages(browser.contents):
81- ... print msg
82- There is 1 error.
83- Incorrect password.
84-
85- >>> browser.getControl('Password').value = 't'
86- >>> browser.url
87- 'http://launchpad.dev/%7Ename12/+deactivate-account'
88- >>> for msg in get_feedback_messages(browser.contents):
89- ... print msg
90- There is 1 error.
91- Incorrect password.
92-
93- >>> browser.getControl('Password').value = 'test'
94 >>> browser.getControl('Deactivate My Account').click()
95 >>> browser.url
96 'http://launchpad.dev'
97
98=== modified file 'lib/lp/registry/templates/person-deactivate-account.pt'
99--- lib/lp/registry/templates/person-deactivate-account.pt 2009-09-15 17:30:28 +0000
100+++ lib/lp/registry/templates/person-deactivate-account.pt 2010-03-16 13:03:31 +0000
101@@ -9,11 +9,6 @@
102
103 <div metal:fill-slot="main">
104 <div metal:use-macro="context/@@launchpad_form/form">
105- <p metal:fill-slot="extra_top">
106- For verification purposes we ask that you enter your Launchpad
107- password. If you've forgotten it you'll have to
108- <a href="/+forgottenpassword">reset it</a> first.
109- </p>
110
111 <div metal:fill-slot="extra_bottom">
112 <p>