fix(ingestion): stop fabricating missing player positions
This commit is contained in:
@ -269,22 +269,16 @@ class LbaSerieAPublicImporter:
|
||||
player = Player.objects.filter(pk=mapping.object_id).first()
|
||||
if player is None:
|
||||
raise ImportValidationError("Player mapping points to a missing record.")
|
||||
position = player.position or Player.Position.SG
|
||||
player.full_name = full_name
|
||||
player.first_name = record["name"]
|
||||
player.last_name = record["surname"]
|
||||
player.position = position
|
||||
player.save()
|
||||
self.summary.players_updated += 1
|
||||
else:
|
||||
# LBA stats endpoint does not expose position directly. To satisfy the current
|
||||
# required model field without guessing role/taxonomy data, we use a neutral
|
||||
# default and keep role/specialty ownership untouched.
|
||||
player = Player.objects.create(
|
||||
full_name=full_name,
|
||||
first_name=record["name"],
|
||||
last_name=record["surname"],
|
||||
position=Player.Position.SG,
|
||||
)
|
||||
self.summary.players_created += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user