diff --git a/mo/web/user.py b/mo/web/user.py index 65cd3c86b75b9dd451e01d4c15c9d1302d99d99e..851b3cc762ba0da229df30f07d8eda59a212346d 100644 --- a/mo/web/user.py +++ b/mo/web/user.py @@ -237,11 +237,12 @@ def join_notify(c: db.Contest) -> None: .filter_by(place_id=place.place_id) .options(joinedload(db.UserRole.user)) .all()) - notify = {ur.user for ur in uroles if ur.applies_to(at=place, year=r.year, cat=r.category, seq=r.seq) and ur.user.email_notify} + notify = {ur.user for ur in uroles if ur.applies_to(at=place, year=r.year, cat=r.category, seq=r.seq)} if notify: for org in notify: - logger.info(f'Join: Notifikuji orga <{org.email}> pro místo {place.get_code()}') - mo.email.send_join_notify_email(org, g.user, c) + logger.info(f'Join: {"Notifikuji" if org.email_notify else "Nenotifikuji"} orga <{org.email}> pro místo {place.get_code()}') + if org.email_notify: + mo.email.send_join_notify_email(org, g.user, c) return place = place.parent_place