From 1a1f02fe122bc29c6a3c2d77fcc703241a8e93aa Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Sat, 14 Jan 2023 20:29:11 +0100
Subject: [PATCH] =?UTF-8?q?Revert=20"Logov=C3=A1n=C3=AD:=20P=C5=99ips?=
 =?UTF-8?q?=C3=A1no=20n=C4=9Bkolik=20flush=C5=AF,=20aby=20byla=20data=20ko?=
 =?UTF-8?q?mpletn=C3=AD"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit b3b2fe8dc0379b03e26c249532a983436654085a.
---
 mo/users.py    | 2 --
 mo/web/user.py | 1 -
 2 files changed, 3 deletions(-)

diff --git a/mo/users.py b/mo/users.py
index e71d9724..96bc328b 100644
--- a/mo/users.py
+++ b/mo/users.py
@@ -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,
diff --git a/mo/web/user.py b/mo/web/user.py
index cc30786a..ee2a348c 100644
--- a/mo/web/user.py
+++ b/mo/web/user.py
@@ -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(
-- 
GitLab