Skip to content
Snippets Groups Projects
Commit 8e1dbf35 authored by Martin Mareš's avatar Martin Mareš Committed by Jan Prachař
Browse files

Registrace: Notifikovat pouze uživatele, kteří si to přejí

Také při té příležitosti eliminujeme duplicitní notifikace, pokud má
někdo více roli k jednomu místu.
parent 1c322479
No related branches found
No related tags found
No related merge requests found
...@@ -237,7 +237,7 @@ def join_notify(c: db.Contest) -> None: ...@@ -237,7 +237,7 @@ def join_notify(c: db.Contest) -> None:
.filter_by(place_id=place.place_id) .filter_by(place_id=place.place_id)
.options(joinedload(db.UserRole.user)) .options(joinedload(db.UserRole.user))
.all()) .all())
notify = [ur.user for ur in uroles if ur.applies_to(at=place, year=r.year, cat=r.category, seq=r.seq)] 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}
if notify: if notify:
for org in notify: for org in notify:
logger.info(f'Join: Notifikuji orga <{org.email}> pro místo {place.get_code()}') logger.info(f'Join: Notifikuji orga <{org.email}> pro místo {place.get_code()}')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment