Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,8 +60,6 @@ def product_panel(product_id):
|
|
| 60 |
@app.route("/products",methods=["GET"])
|
| 61 |
def products():
|
| 62 |
global user
|
| 63 |
-
if user=="null":
|
| 64 |
-
return redirect(url_for('login'))
|
| 65 |
with open("products.json") as f:
|
| 66 |
data=json.load(f)
|
| 67 |
f.close()
|
|
@@ -69,11 +67,6 @@ def products():
|
|
| 69 |
@app.route("/login",methods=['GET',"POST"])
|
| 70 |
def login():
|
| 71 |
global user
|
| 72 |
-
if user!="null":
|
| 73 |
-
with open("products.json") as file:
|
| 74 |
-
data=json.load(file)
|
| 75 |
-
file.close()
|
| 76 |
-
return redirect(url_for('products'))
|
| 77 |
if request.method=="POST":
|
| 78 |
with open("seller.json") as f:
|
| 79 |
data=json.load(f)
|
|
@@ -96,11 +89,6 @@ def login():
|
|
| 96 |
@app.route("/sign_up",methods=["GET","POST"])
|
| 97 |
def sign_up():
|
| 98 |
global user
|
| 99 |
-
if user!="null":
|
| 100 |
-
with open("products.json") as f:
|
| 101 |
-
data=json.load(f)
|
| 102 |
-
f.close()
|
| 103 |
-
return redirect(url_for("products"))
|
| 104 |
if request.method=="GET":
|
| 105 |
return render_template("Signup.html")
|
| 106 |
else:
|
|
|
|
| 60 |
@app.route("/products",methods=["GET"])
|
| 61 |
def products():
|
| 62 |
global user
|
|
|
|
|
|
|
| 63 |
with open("products.json") as f:
|
| 64 |
data=json.load(f)
|
| 65 |
f.close()
|
|
|
|
| 67 |
@app.route("/login",methods=['GET',"POST"])
|
| 68 |
def login():
|
| 69 |
global user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
if request.method=="POST":
|
| 71 |
with open("seller.json") as f:
|
| 72 |
data=json.load(f)
|
|
|
|
| 89 |
@app.route("/sign_up",methods=["GET","POST"])
|
| 90 |
def sign_up():
|
| 91 |
global user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
if request.method=="GET":
|
| 93 |
return render_template("Signup.html")
|
| 94 |
else:
|