Skip to content
Snippets Groups Projects
Commit 1a1f02fe authored by Martin Mareš's avatar Martin Mareš
Browse files

Revert "Logování: Připsáno několik flushů, aby byla data kompletní"

This reverts commit b3b2fe8d.
parent 1c1c77a2
Branches
No related tags found
1 merge request!129Bezpečné transakce při zakládání uživatelů/účastníků/účastí
......@@ -146,7 +146,6 @@ def find_or_create_participant(user: db.User, year: int, school_id: Optional[int
raise mo.CheckError('Osoba s daným e-mailem zatím není zaregistrovaná do ročníku, je nutné uvést ročník.')
part = db.Participant(user=user, year=year, school=school_id, birth_year=birth_year, grade=grade)
sess.add(part)
sess.flush() # Kvůli logování
logger.info(f'{reason.title()}: Založen účastník #{user.user_id}')
mo.util.log(
type=db.LogType.participant,
......@@ -175,7 +174,6 @@ def find_or_create_participation(user: db.User, contest: db.Contest, place: Opti
if is_new:
pion = db.Participation(user=user, contest=contest, place_id=place.place_id, state=db.PartState.active)
sess.add(pion)
sess.flush() # Kvůli logování
logger.info(f'{reason.title()}: Založena účast user=#{user.user_id} contest=#{contest.contest_id} place=#{place.place_id}')
mo.util.log(
type=db.LogType.participant,
......
......@@ -221,7 +221,6 @@ def join_create_pion(c: db.Contest) -> None:
state = db.PartState.registered
p = db.Participation(user=g.user, contest=c, place=c.place, state=state)
sess.add(p)
sess.flush() # Kvůli logování
logger.info(f'Join: Účastník #{g.user.user_id} přihlášen do soutěže #{c.contest_id}')
mo.util.log(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment