From 2dba6bec473f3cb730f7cf8b11a57534b70ea64f Mon Sep 17 00:00:00 2001 From: Michael Stambach Date: Mon, 21 Oct 2024 18:05:25 +0200 Subject: [PATCH] shortened some lines :) --- amivapi/events/emails.py | 6 +++++- amivapi/events/queue.py | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/amivapi/events/emails.py b/amivapi/events/emails.py index bc32e4d5..be510ccc 100644 --- a/amivapi/events/emails.py +++ b/amivapi/events/emails.py @@ -28,7 +28,11 @@ def find_reply_to_email(event): return current_app.config.get('DEFAULT_EVENT_REPLY_TO') -def notify_signup_accepted(event, signup, waiting_list=False, spots_available=False): +def notify_signup_accepted( + event, + signup, + waiting_list=False, + spots_available=False): """Send an email to a user that his signup was accepted""" id_field = current_app.config['ID_FIELD'] diff --git a/amivapi/events/queue.py b/amivapi/events/queue.py index 45b9f3c8..e2f8a2f0 100644 --- a/amivapi/events/queue.py +++ b/amivapi/events/queue.py @@ -101,9 +101,11 @@ def update_waiting_list_after_insert(signups): event = current_app.data.find_one('events', None, **lookup) lookup = {'event': event_id, 'accepted': True} signup_count = ( - current_app.data.driver.db['eventsignups'].count_documents(lookup)) + current_app.data.driver.db['eventsignups']\ + .count_documents(lookup)) if event is not None: - if event['selection_strategy'] == "manual" and signup_count < event['spots']: + if event['selection_strategy'] == "manual" \ + and signup_count < event['spots']: notify_signup_accepted(event, signup, True, True) else: notify_signup_accepted(event, signup, True, False)