Tweaks for new user data structure

This commit is contained in:
2015-10-13 23:17:00 +02:00
parent 2ad8c5458a
commit d26b3a738a
2 changed files with 9 additions and 5 deletions

View File

@@ -89,15 +89,20 @@ def validate_token():
users = app.data.driver.db['users']
email = validation['data']['user']['email']
db_user = users.find_one({'email': email})
tmpname = email.split('@')[0]
username = email.split('@')[0]
full_name = username
if not db_user:
user_data = {
'full_name': tmpname,
'full_name': full_name,
'username': username,
'email': email,
'auth': list(dict(provider='blender-id',
user_id=validation['data']['user']['id']))
'auth': [{
'provider': 'blender-id',
'user_id': str(validation['data']['user']['id']),
'token': ''}]
}
r = post_internal('users', user_data)
print r
user_id = r[0]['_id']
groups = None
else:

View File

@@ -32,7 +32,6 @@ users_schema = {
'roles': {
'type': 'list',
'allowed': ["admin"],
'required': True,
},
'groups': {
'type': 'list',