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

Issue 45 #47

Merged
merged 2 commits into from
Oct 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ Changelog
0.32 (unreleased)
~~~~~~~~~~~~~~~~~

Nothing yet.
- Update the catalog after renaming a person #45.
[msom]

0.31 (2015-05-03)
~~~~~~~~~~~~~~~~~

- Fix an error in ZodbMembershipSource #44.
[msom]

0.30 (2015-04-09)
~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions seantis/people/behaviors/name_from_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def on_object_modified(obj, event=None):
"""

obj.setTitle(get_name_from_person(obj))
obj.reindexObject()


def get_name_from_person(obj):
Expand Down
2 changes: 1 addition & 1 deletion seantis/people/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<metadata>
<version>1012</version>
<version>1013</version>
<dependencies>
<dependency>profile-plone.app.dexterity:default</dependency>
<dependency>profile-collective.js.underscore:default</dependency>
Expand Down
24 changes: 24 additions & 0 deletions seantis/people/tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,27 @@ def test_remove_from_list(self):
browser.open(list_url)
self.assertNotIn('Claire', browser.contents)
self.assertNotIn('Dunphy', browser.contents)

def test_rename_person(self):
list_url = self.new_people_list()
self.new_person('Claire', 'Dunphy')

browser = self.new_admin_browser()

browser.open(list_url)
self.assertIn('Dunphy', browser.contents)
browser.open(self.baseurl + '/@@search?SearchableText=Dunphy')
self.assertIn('Claire', browser.contents)
browser.open(self.baseurl + '/@@search?SearchableText=Griffin')
self.assertIn('No results were found', browser.contents)

browser.open(list_url + '/dunphy-claire/edit')
browser.getControl('Last Name').value = 'Griffin'
browser.getControl('Save').click()

browser.open(list_url)
self.assertIn('Griffin', browser.contents)
browser.open(self.baseurl + '/@@search?SearchableText=Dunphy')
self.assertIn('No results were found', browser.contents)
browser.open(self.baseurl + '/@@search?SearchableText=Griffin')
self.assertIn('Claire', browser.contents)
3 changes: 3 additions & 0 deletions seantis/people/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,6 @@ def enable_referenceablebehavior(context):
def reindex_members(context):
catalog = api.portal.get_tool(catalog_id)
catalog.refreshCatalog(clear=1)

catalog = api.portal.get_tool('portal_catalog')
catalog.refreshCatalog(clear=1)
7 changes: 7 additions & 0 deletions seantis/people/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
handler=".upgrades.reindex_members"
/>

<genericsetup:upgradeStep
title="Reindex members."
source="1012" destination="1013"
profile="seantis.people:default"
handler=".upgrades.reindex_members"
/>

<!-- PHZ Upgrades -->
<genericsetup:upgradeStep
title="Remove import action from detail view."
Expand Down