eestec / eestec.portal

The main repository for the eestec.net portal, holding in buildout configs, site policy, content types, email notifications, workflows, template overrides, tests, etc.
7 stars 3 forks source link

Groups are not created for every new LC #36

Closed balkian closed 11 years ago

balkian commented 11 years ago

1.- Create a new LC through /lc/++add++eestec.portal.lc 2.- Go to Users and Groups in the site management page 3.- Click show all 4.- There aren't any new groups

zupo commented 11 years ago
  1. See how to subscribe to "object is created" event: https://github.com/eestec/eestec.portal/blob/master/src/eestec/portal/content/event.py#L39
  2. Do the same for "LC is created" by adding similar code to content/lc.py
  3. Use plone.api to create a group (rather than to send an email like code in step 1. does): http://ploneapi.readthedocs.org/en/latest/group.html#create-group
balkian commented 11 years ago

It actually works as it is... But under the Plone/add-lc URL.

See: https://github.com/eestec/eestec.portal/blob/master/src/eestec/portal/content/lc.py#L75

Adding all the datafields to the ILC class works, but it obviously shows more data than it should in the LC view. Adapting the SchemaForm gave more errors.

So in the end I changed the class of AddLCForm to dexterity.AddForm, and rename it to AddForm as seen here http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/forms

Check commit da5309f1361dd8cb98b9c9d483b4ba544be433da on issue_36