[boardgames] Check if scrobble exists first
This commit is contained in:
@ -445,7 +445,15 @@ def email_scrobble_board_game(
|
||||
"log": log_data,
|
||||
}
|
||||
|
||||
print(scrobble_dict)
|
||||
scrobble = Scrobble.objects.filter(
|
||||
board_game=base_game, user_id=user_id, timestamp=start
|
||||
).first()
|
||||
if scrobble:
|
||||
logger.info(
|
||||
"Scrobble already exists, skipping",
|
||||
extra={"scrobble_dict": scrobble_dict, "user_id": user_id},
|
||||
)
|
||||
continue
|
||||
scrobble = Scrobble.create_or_update(base_game, user_id, scrobble_dict)
|
||||
scrobble.stop_timestamp = stop
|
||||
scrobble.in_progress = False
|
||||
|
||||
Reference in New Issue
Block a user