Subbu1304 commited on
Commit
e8739e9
·
verified ·
1 Parent(s): e0d98f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -78,13 +78,14 @@ def register():
78
  'Phone_Number__c': phone
79
  })
80
 
 
81
  if customer_login.get('id'):
82
  return jsonify({'success': True, 'user_id': customer_login['id']}), 200
83
  else:
84
- return jsonify({'error': 'Failed to create record'}), 500
85
 
86
  except Exception as e:
87
- return jsonify({'error': str(e)}), 500
88
 
89
  # Start Production Server
90
  if __name__ == "__main__":
 
78
  'Phone_Number__c': phone
79
  })
80
 
81
+ # Check if the record was successfully created
82
  if customer_login.get('id'):
83
  return jsonify({'success': True, 'user_id': customer_login['id']}), 200
84
  else:
85
+ return jsonify({'error': 'Failed to create record in Salesforce'}), 500
86
 
87
  except Exception as e:
88
+ return jsonify({'error': f"Error creating user: {str(e)}"}), 500
89
 
90
  # Start Production Server
91
  if __name__ == "__main__":