mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -07:00
fix webhook bug
This commit is contained in:
parent
47e25ab705
commit
54b93bf1dd
2 changed files with 16 additions and 13 deletions
|
@ -63,7 +63,6 @@ def get_todays_meal(session: Session, group: Union[int, GroupInDB]) -> Recipe:
|
||||||
if isinstance(group, int):
|
if isinstance(group, int):
|
||||||
group: GroupInDB = db.groups.get(session, group)
|
group: GroupInDB = db.groups.get(session, group)
|
||||||
|
|
||||||
if group.webhook_enable:
|
|
||||||
today_slug = None
|
today_slug = None
|
||||||
|
|
||||||
for mealplan in group.mealplans:
|
for mealplan in group.mealplans:
|
||||||
|
|
|
@ -9,6 +9,10 @@ from sqlalchemy.orm.session import Session
|
||||||
def post_webhooks(group: int, session: Session = None):
|
def post_webhooks(group: int, session: Session = None):
|
||||||
session = session if session else create_session()
|
session = session if session else create_session()
|
||||||
group_settings: GroupInDB = db.groups.get(session, group)
|
group_settings: GroupInDB = db.groups.get(session, group)
|
||||||
|
|
||||||
|
if not group_settings.webhook_enable:
|
||||||
|
return
|
||||||
|
|
||||||
todays_recipe = get_todays_meal(session, group)
|
todays_recipe = get_todays_meal(session, group)
|
||||||
|
|
||||||
if not todays_recipe:
|
if not todays_recipe:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue