Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix bib and card_numbers indexes #440

Merged
merged 7 commits into from
Aug 18, 2024

Conversation

alex-karpov
Copy link
Contributor

Починил (надеюсь) индекс номеров участников и чипов.

Доступ к номеру участника и чипу сделал через getter/setter и убрал change_bib() — для исключения случайного присваивания без изменения индекса.

Обновление индекса при удалении спортсменов.

Обнаружил, что при открытии базы с несколькими днями, пересчёт результатов/сплитов происходит только для текущего дня, для остальных дней пересчёта не происходит. Сделал, чтобы индексы создавались для всех дней. Не возникнет ли проблема с проверкой отметки — не знаю.

В некоторых случаях возможны одинаковые номера и одинаковые чипы (жеребьёвка, массовое редактирование). Добавил сообщение в логи.

Дублирующиеся номера/чипы — потенциально неприятный момент. Если создали участника с дублирующимся чипом, а затем удалили его — этот чип пропадёт из индекса. И первого при считывании исходный участник автоматически не определится (наверное).

Co-authored-by: Danil Akhtarov <daxartio@gmail.com>
other_person = r.person_index_bib[new_bib]
if not other_person is self:
logging.info(
f'Duplicate bib {new_bib} (do nothing): {self} | {other_person}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f'Duplicate bib {new_bib} (do nothing): {self} | {other_person}'
'Duplicate bib %s (do nothing): %s | %s', new_bib, self, other_person

other_person = r.person_index_card[new_card]
if not other_person is self:
logging.info(
f'Duplicate card {new_card} (do nothing): {self} | {other_person}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same ⬆️

@daxartio daxartio merged commit b571fe9 into sportorg:master Aug 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants