diff --git a/amivapi/events/email_links.py b/amivapi/events/email_links.py index 801803178d40ef63a2ff4060b6ebfcdd6ec95d6d..b95ddb808c199d0882f8bb66b80b9045af742d59 100644 --- a/amivapi/events/email_links.py +++ b/amivapi/events/email_links.py @@ -15,6 +15,7 @@ from itsdangerous import BadSignature, URLSafeSerializer from amivapi.events.queue import update_waiting_list from amivapi.events.utils import get_token_secret +from amivapi.events.emails import notify_signup_accepted email_blueprint = Blueprint('emails', __name__) @@ -53,6 +54,12 @@ def on_confirm_email(token): update_waiting_list(signup['event']) + # refresh the signup to get the updated data + signup = current_app.data.find_one('eventsignups', None, **lookup) + if not signup.get["accepted"]: + # if the user is on the waitinglist he doesn't get notified. + notify_signup_accepted(signup['event'], signup, True) + redirect_url = current_app.config.get('EMAIL_CONFIRMED_REDIRECT') if redirect_url: return redirect(redirect_url)