Works for now
This commit is contained in:
10
app.py
10
app.py
@@ -1,4 +1,4 @@
|
||||
# app.py (updated)
|
||||
# app.py (final version)
|
||||
from flask import Flask, render_template, request, redirect, url_for, session, flash
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from datetime import datetime
|
||||
@@ -37,8 +37,6 @@ with app.app_context():
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
if 'user_id' in session:
|
||||
return redirect(url_for('dashboard'))
|
||||
return render_template('index.html')
|
||||
|
||||
@app.route('/register', methods=['GET', 'POST'])
|
||||
@@ -180,15 +178,13 @@ def delete_record(record_id):
|
||||
|
||||
@app.route('/predict_diseases', methods=['POST'])
|
||||
def predict_diseases():
|
||||
if 'user_id' not in session:
|
||||
return redirect(url_for('login'))
|
||||
|
||||
# Make this endpoint publicly accessible
|
||||
current_disease = request.form['current_disease'].strip()
|
||||
|
||||
# In a real application, this would process the data and generate predictions
|
||||
# For demonstration, we'll just simulate the result based on some common patterns
|
||||
|
||||
# Get all health records to analyze correlations
|
||||
# Get all health records to analyze correlations (no user session required)
|
||||
all_records = HealthRecord.query.all()
|
||||
|
||||
# Simple correlation analysis (would be more complex in reality)
|
||||
|
||||
Reference in New Issue
Block a user