Ejemplo n.º 1
0
def get_today():
    """
    Returns the recipe slug for the meal scheduled for today.
    If no meal is scheduled nothing is returned
    """

    return MealPlan.today()
Ejemplo n.º 2
0
def get_today(session: Session = Depends(generate_session)):
    """
    Returns the recipe slug for the meal scheduled for today.
    If no meal is scheduled nothing is returned
    """

    return MealPlan.today(session)
Ejemplo n.º 3
0
def post_webhooks():
    all_settings = SiteSettings.get_site_settings()

    if all_settings.webhooks.enabled:
        todays_meal = Recipe.get_by_slug(MealPlan.today()).dict()
        urls = all_settings.webhooks.webhookURLs

        for url in urls:
            requests.post(url, json.dumps(todays_meal, default=str))
Ejemplo n.º 4
0
def post_webhooks():
    session = create_session()
    all_settings = db.get(session, "main")
    all_settings = SiteSettings(**all_settings)

    if all_settings.webhooks.enabled:
        todays_meal = Recipe.get_by_slug(MealPlan.today()).dict()
        urls = all_settings.webhooks.webhookURLs

        for url in urls:
            requests.post(url, json.dumps(todays_meal, default=str))

    session.close()