Skip to content

Commit

Permalink
less error spam
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Jan 9, 2024
1 parent dc6c148 commit 7f5ecd4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/v1/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ async def update_reports(
return {"detail": f"{data.rowcount} rows updated to reportingID = {new_user_id}."}

async def insert_active_reporter(reporter: str):
if 'anonymoususer' in reporter:
return
try:
sql: Text = text("INSERT INTO activeReporters (name) VALUES (:reporter)")

Expand All @@ -208,6 +210,9 @@ async def insert_active_reporter(reporter: str):
async with session.begin():
await session.execute(sql, {"reporter": reporter})
except Exception as e:
e = str(e)
if 'Duplicate entry' in e:
return
logger.error(str(e))


Expand Down

0 comments on commit 7f5ecd4

Please sign in to comment.