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:
return jsonify(response_object), code
if not activity.gpx or activity.gpx == '':
response_object = {
'status': 'fail',
'message': f'No gpx file for this activity (id: {activity_id})',
}
message = f'No gpx file for this activity (id: {activity_id})'
response_object = {'status': 'fail', 'message': message}
return jsonify(response_object), 400
try:

View File

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