Skip to content

Commit

Permalink
Merge pull request #39 from eea/master
Browse files Browse the repository at this point in the history
Refs #33 - Fix "Add new user" form when there are too many groups.
  • Loading branch information
avoinea committed May 18, 2015
2 parents b3e3771 + 7c31a7f commit 98b4d89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ CHANGES
2.2.2 (unreleased)
------------------

- Nothing changed yet.
- Fixed "Add new user" form when there are too many groups.
Fixes https://github.com/plone/plone.app.users/issues/33
[avoinea]


2.2.1 (2015-05-04)
Expand Down
12 changes: 8 additions & 4 deletions plone/app/users/browser/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,14 @@ def updateFields(self):
defaultFields['mail_me'].field.default = False

# Append the manager-focused fields
allFields = defaultFields + field.Fields(IAddUserSchema)

allFields['groups'].widgetFactory = CheckBoxFieldWidget

portal_props = getToolByName(self.context, 'portal_properties')
props = portal_props.site_properties
many_groups = props.getProperty('many_groups', False)
if not many_groups:
allFields = defaultFields + field.Fields(IAddUserSchema)
allFields['groups'].widgetFactory = CheckBoxFieldWidget
else:
allFields = defaultFields
self.fields = allFields

def updateWidgets(self):
Expand Down

0 comments on commit 98b4d89

Please sign in to comment.