Hi All,

The workflow approach worked well.  Here are the various bits of the
solution for completeness sake:

- A custom Member type (inheriting from
Products.remember.content.member.Member) with the following schema
modifications:
  - new fields for first name and surname
  - hide the existing id and fullname fields (with .widget.visible =
{'edit': 'hidden', 'view': 'invisible'})
  - remove the password field from the registration form
(with .regfield=0)
- An external method to change the members id based on the first name
and surname:

def rename_username(self, state_change):
    try:
        obj = state_change.object
        first = self.getFirstname()
        surname = self.getSurname()
        username = generateUserName(self, first, surname)
        obj.setId(username)
        log('set username to %s' % username)
    except:
        log_exc()

- Call the rename method in the register_public transition of our
approval workflow (essentially a copy of remember's
member_approval_workflow with a workflow_id change to make it
unique).  I tried the before_script of the auto_pending transition,
but I got the same permission error.

    <transition transition_id="register_public"
             title="Approve member, make profile public"
             new_state="public" trigger="USER"
             before_script="rename_username" after_script="register">

Ok, cool- thanks your your help, and I hope this helps someone else
trying to do something similar.

cool
michael


--
Archive: 
http://www.openplans.org/projects/remember/lists/remember/archive/2008/06/1213262960947
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to