filter product

This commit is contained in:
Reihan 2025-05-03 22:36:42 +07:00
parent 7c05dd14fc
commit cf50431beb

8
app.py
View File

@ -239,7 +239,7 @@ def send_email():
resend.Emails.send(params) resend.Emails.send(params)
# Fetch user details from the database # Fetch user details from the database
cred = supabase.table('vertexgpu-cred').select('username, password').eq('taken', False).eq(product).order('id').execute() cred = supabase.table('vertexgpu-cred').select('username, password').eq('taken', False).eq('gpu', product).order('id').execute()
if cred.data: if cred.data:
usernamedb = cred.data[0]['username'] usernamedb = cred.data[0]['username']
password = cred.data[0]['password'] password = cred.data[0]['password']
@ -397,8 +397,10 @@ def send_email():
resend.Emails.send(params) resend.Emails.send(params)
return jsonify({'status': 'success', 'message': 'email sent'}) return jsonify({'status': 'success', 'message': 'email sent'})
except: except Exception as e:
return jsonify({'status': 'error', 'message': 'Failed to send email'}), 500 message = f"Error: {e}"
print(message)
return jsonify({'status': 'error', 'message': message}), 500
@app.route('/health') @app.route('/health')
def health(): def health():