API - minor change

This commit is contained in:
Sam 2019-08-28 14:34:18 +02:00
parent 7f3dfd5049
commit 318418bd55
2 changed files with 4 additions and 8 deletions

View File

@ -380,10 +380,8 @@ def get_activity_data(auth_user_id, activity_id, data_type, segment_id=None):
if response_object: if response_object:
return jsonify(response_object), code return jsonify(response_object), code
if not activity.gpx or activity.gpx == '': if not activity.gpx or activity.gpx == '':
response_object = { message = f'No gpx file for this activity (id: {activity_id})'
'status': 'fail', response_object = {'status': 'fail', 'message': message}
'message': f'No gpx file for this activity (id: {activity_id})',
}
return jsonify(response_object), 400 return jsonify(response_object), 400
try: try:

View File

@ -432,10 +432,8 @@ def edit_user(user_id):
if password is not None and password != '': if password is not None and password != '':
if password_conf != password: if password_conf != password:
response_object = { message = 'Password and password confirmation don\'t match.\n'
'status': 'error', response_object = {'status': 'error', 'message': message}
'message': 'Password and password confirmation don\'t match.\n',
}
return jsonify(response_object), 400 return jsonify(response_object), 400
else: else:
password = bcrypt.generate_password_hash( password = bcrypt.generate_password_hash(