stormpath / stormpath-django

Django plugin for Stormpath
Apache License 2.0
38 stars 19 forks source link

Add Groups To User Sync Method #80

Closed pnovotnak closed 8 years ago

pnovotnak commented 8 years ago

@javierbq found that my previous pull request (#78) had a bug--as it doesn't sync groups, if a user logs into the Django site after the sync, their group memberships are deleted from Stormpath. This PR fixes that bug by also syncing groups from stormpath to the local database. A flag is added to the renamed function (models.StormpathUserManager.sync_accounts() -> models.StormpathUserManager.sync_accounts_from_stormpath()) called _syncgroups who's default value is True. Currently this flag is not settable from the management command, since the result of not setting it to False is very non-obvious IMO and def. Requires a big, well written warning before it is provided as a command line option to users.

Summary of changes;

rdegges commented 8 years ago

Thanks, I just fixed all broken tests, and will get this released shortly.