Skip to content

Commit

Permalink
shortened some lines :)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstambach committed Oct 21, 2024
1 parent 3acede5 commit 2dba6be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion amivapi/events/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down
6 changes: 4 additions & 2 deletions amivapi/events/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2dba6be

Please sign in to comment.