Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Move PasswordResetTool to CMFPlone #1799

Closed
wants to merge 34 commits into from

Conversation

tomgross
Copy link
Member

@tomgross tomgross commented Oct 20, 2016

Move PasswordResetTool to CMFPlone since there are interdependencies anyway.
This PR additionally does:

  • Move ZMI / DTML configuration form into a Plone page
  • Move CMFFormController to BrowserViews
  • Replace djange_randomstring with plone.uuid generator

With this PR merged Products.PasswordResetTool is no longer necessary.

@jensens
Copy link
Sponsor Member

jensens commented Oct 21, 2016

I know that some addons are (ab)using PasswordResetTool for other similar tasks. But I can not find code importing from there, just using the tool instance. So this should be not a problem to merge once finished.

return self.manage_overview(manage_tabs_message="Returning username check turned %s" % m)

def __init__(self):
self._requests = {}
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're moving the password tool, let's change this to a BTree. We had a customer with a site that had self-registration turned on and was getting spam accounts created, and the database grew rapidly because each new user saved a new copy of this entire dict.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea. I'll look into this

mail_text = self.registered_notify_template(
self, self.REQUEST, member=member, reset=reset, email=email,
charset=encoding)
registered_notify_template = getMultiAdapter(
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sort of lookup would be more readable if we had a "getView" utility function in CMFPlone.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the first glance this sounds tempting but getting the multi-adapter is well documented and changing it would lead to different patterns all over the place.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I realize the suggestion is outside the scope of this pull request. But I think it's something we should consider changing in all those places. :)

@@ -31,7 +31,7 @@
<required tool_id="portal_migration"
class="Products.CMFPlone.MigrationTool.MigrationTool"/>
<required tool_id="portal_password_reset"
class="Products.PasswordResetTool.PasswordResetTool.PasswordResetTool"/>
class="Products.CMFPlone.PasswordResetTool.PasswordResetTool"/>
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember this will require an upgrade step in plone.app.upgrade.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I guess the goal should be to get rid of the tool all together, since the methods can go to the view classes and the storage to the Plone site directly.

@@ -10,7 +10,8 @@
from Testing.ZopeTestCase import ZopeDocFileSuite


UNITTESTS = ['messages.txt', 'mails.txt', 'emaillogin.txt', 'translate.txt']
UNITTESTS = ['messages.txt', 'mails.txt', 'emaillogin.txt', 'translate.txt',
'pwreset_browser.txt']
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you up for converting the doctest to unit tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. But this way I make sure the tests in pwreset_browser.txt are not run twice. They are already called by test_passwordreset with a custom testsetup. The name UNITTESTS is misleading. It really is IGNORE_THIS_DOCS_FROM_TESTS

@tomgross
Copy link
Member Author

Superseded by #1809

@tomgross tomgross closed this Oct 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants