Skip to content

Commit

Permalink
Don't save user history until migration is done
Browse files Browse the repository at this point in the history
  • Loading branch information
ishefi committed Jan 14, 2024
1 parent f6378d9 commit 46eaf14
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions logic/user_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,6 @@ async def update_and_get_history(
history = await self.get_history()
if guess.similarity is not None:
history.append(guess)
with hs_transaction(self.session) as session:
user_query = select(tables.User).where(
tables.User.email == self.user["email"]
)
user = session.exec(user_query).first()
if user is None:
logger.warning("User not found")
else:
session.add(
tables.UserHistory(
user_id=user.id,
guess=guess.guess,
similarity=guess.similarity,
distance=guess.distance,
egg=guess.egg,
game_date=self.dt,
solver_count=guess.solver_count,
)
)
return await self._fix_history(history, update_db=True)
else:
return [guess] + history
Expand Down

0 comments on commit 46eaf14

Please sign in to comment.