Open ejucovy opened 13 years ago
Implemented in bce1379 -- for users joining groups. I haven't yet implemented it for events.
Also, it's somewhat overeager: the code will fire any time a user's group associations change, which includes becoming an admin of the group. That seems fine to me, since we want to be aggressive about collecting user locations.
As long as it's not writing over what's already there in any case, this should be fine.
We don't want to require users to provide a zipcode when they register. However, collecting users' physical location (at least city and country) is pretty crucial to 350.org's ongoing organizing efforts.
We do require communities to provide a location ("Headquarters") -- and we also require events to provide a location ("Street Address")
So if a user doesn't provide a location, we can guess at that user's location based on his associations.
Whenever a user joins a community or an event, check if the user has a zipcode filled in on his profile; if he doesn't, set the zipcode on his profile to the zipcode of the community or event that he just joined.
By modifying the user record itself, the user
post_save
signal will fire, and this data will get pushed over to ActionKit as well.