member.setProperties() and member.setMemberProperties()ΒΆ

Tags: plone

I took me an hour to figure out that member.setProperties() isn't the only game in town. There's also member.setMemberProperties(). If you've grabbed a member (in my case by iteration over all members in a site and checking whether some memberdata value needs to be migrated), the following is true:

  • member.setProperties() sets the properties on the currently authenticated uses. So if "reinout" is logged in and I'm calling setProperties() on the member "maurits", it are still reinout's properties that are getting set. What?? member.getProperty properly gets member's properties instead of those of the currently authenticated user.
  • member.setMemberProperties() actually sets the properties on member.

This one surprised me.

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):