diff options
Diffstat (limited to 'scripts/recipes/handle_recipes.py')
-rw-r--r-- | scripts/recipes/handle_recipes.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/recipes/handle_recipes.py b/scripts/recipes/handle_recipes.py index 22ba0a4..73d19be 100644 --- a/scripts/recipes/handle_recipes.py +++ b/scripts/recipes/handle_recipes.py @@ -1,10 +1,12 @@ from bson.objectid import ObjectId +from flask import session from scripts.database.mongo import mongo_database from scripts.scraping.scraper import scrape mongo_collection = mongo_database.get_collection("recipes") def add_single_recipe(recipe): + recipe["user"] = session["username"] added_recipe = mongo_collection.insert_one(recipe) new_recipe = mongo_collection.find_one() return added_recipe |