From 99c2464f05004b10589e1b7ce73878057145e644 Mon Sep 17 00:00:00 2001 From: al6862 Date: Wed, 28 Feb 2024 14:53:23 -0500 Subject: [PATCH] added mainDecks --- app.py | 3 ++- authentication.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 24f5437..3222b34 100644 --- a/app.py +++ b/app.py @@ -41,7 +41,8 @@ def allDecks(username): return redirect('/login') else: user = db.users.find_one({'user_id': current_user.id}) - return render_template('decks.html', mainDecks = user['mainDecks'], personalDecks = user['personalDecks']) + mainDecks = db.decks.find({}) + return render_template('decks.html', mainDecks = mainDecks, personalDecks = user['personalDecks']) @app.route("//") diff --git a/authentication.py b/authentication.py index f094140..593f485 100644 --- a/authentication.py +++ b/authentication.py @@ -63,7 +63,7 @@ def auth_signup(): return render_template('signup.html', username_taken=False, passwords_dont_match=True) else: user = User(user_id, generate_password_hash(password)) - db['users'].insert_one({"user_id": user.id, "password": user.password, 'mainDecks': [], 'personalDecks': []}) + db['users'].insert_one({"user_id": user.id, "password": user.password, 'personalDecks': []}) login_user(user) # TODO: Redirect to the appropriate page for the logged in user return redirect('/' + user_id + '/decks')