stormpath / stormpath-django

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

get_or_create() raises a Stormpath error #50

Closed smcoll closed 8 years ago

smcoll commented 9 years ago
>>> from django.contrib.auth import get_user_model
>>> User = get_user_model()
>>> user, created = User.objects.get_or_create(email='me@example.com', password='foo', given_name='Sample', surname='User')
...
Error: {u'status': 400, u'developerMessage': u'Account password cannot be null, empty, or blank.', u'message': u'Account password cannot be null, empty, or blank.', u'code': 2000, u'moreInfo': u'http://docs.stormpath.com/errors/2000'}

Seems we're going to need to override StormpathUserManager._create_object_from_params() such that the password keyword argument is handled properly. In this case, password is passed as None because set_password isn't called.

That should fix StormpathUserManager.get_or_create() and StormpathUserManager.update_or_create()

rdegges commented 9 years ago

I'll be merging this in soon, @avojnovicDk is fixing some merge conflicts. Once this gets in I'll cut a new release.

rdegges commented 8 years ago

Closing this as it is merged and I'm releasing now.