Skip to content

Commit

Permalink
fix: remove deleted events from cron actions
Browse files Browse the repository at this point in the history
  • Loading branch information
uds5501 committed Aug 2, 2019
1 parent 9fc0c20 commit 12bd546
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/api/helpers/scheduled_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
def send_after_event_mail():
from app import current_app as app
with app.app_context():
events = Event.query.all()
events = Event.query.filter_by(state='published', deleted_at=None).all()
upcoming_events = get_upcoming_events()
upcoming_event_links = "<ul>"
for upcoming_event in upcoming_events:
Expand Down Expand Up @@ -70,7 +70,7 @@ def change_session_state_on_event_completion():
def send_event_fee_notification():
from app import current_app as app
with app.app_context():
events = Event.query.all()
events = Event.query.filter_by(deleted_at=None).all()
for event in events:
latest_invoice = EventInvoice.query.filter_by(
event_id=event.id).order_by(EventInvoice.created_at.desc()).first()
Expand Down Expand Up @@ -177,7 +177,7 @@ def event_invoices_mark_due():
def send_monthly_event_invoice():
from app import current_app as app
with app.app_context():
events = Event.query.all()
events = Event.query.filter_by(deleted_at=None).all()
for event in events:
# calculate net & gross revenues
currency = event.payment_currency
Expand Down

0 comments on commit 12bd546

Please sign in to comment.