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

Přihláška: Org s vypnutým email_notify nezpůsobuje eskalaci vyšším garantům

Pokud na nějaké úrovni hierarchie existují garanti, ale všichni mají
vypnuté email_notify, nechceme přejít na vyšší úroveň.
parent 10930f2b
Branches
No related tags found
No related merge requests found
...@@ -237,10 +237,11 @@ def join_notify(c: db.Contest) -> None: ...@@ -237,10 +237,11 @@ 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) 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: 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" 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) mo.email.send_join_notify_email(org, g.user, c)
return return
place = place.parent_place place = place.parent_place
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment