Prevent set(None) call

This commit is contained in:
Sybren A. Stüvel 2016-06-14 09:45:20 +02:00
parent 08fceeffc0
commit 57e07db972

View File

@ -60,7 +60,7 @@ def badger():
return 'User not found', 404
# Apply the action
roles = set(db_user['roles'] or [])
roles = set(db_user.get('roles', []) or [])
if action == 'grant':
roles.add(role)
else: