Lots of small NPE and other exception fixes

This commit is contained in:
Joseph Schorr 2014-09-15 11:27:33 -04:00
parent 511ee12a58
commit e8ad01cb41
5 changed files with 22 additions and 4 deletions

View file

@ -66,6 +66,9 @@ def generate_headers(role='read'):
@index.route('/users/', methods=['POST'])
def create_user():
user_data = request.get_json()
if not 'username' in user_data:
abort(400, 'Missing username')
username = user_data['username']
password = user_data.get('password', '')