Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove deleted events from cron actions #6295

Merged
merged 1 commit into from
Aug 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, state='published').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, state='published').all()
for event in events:
# calculate net & gross revenues
currency = event.payment_currency
Expand Down