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: rebuild indexes after major changing/deleting bibs and cards operations #445

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sportorg/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ def _delete_object(self):
res = race().delete_persons(indexes)
ResultCalculation(race()).process_results()
live_client.delete(res)
race().rebuild_indexes()
elif tab == 1:
res = race().delete_results(indexes)
ResultCalculation(race()).process_results()
Expand Down
2 changes: 2 additions & 0 deletions sportorg/gui/menu/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,15 @@ def execute(self):
class TextExchangeAction(Action, metaclass=ActionFactory):
def execute(self):
TextExchangeDialog().exec_()
race().rebuild_indexes()
self.app.refresh()


class MassEditAction(Action, metaclass=ActionFactory):
def execute(self):
if self.app.current_tab == 0:
MassEditDialog().exec_()
race().rebuild_indexes()
self.app.refresh()

if self.app.current_tab == 2:
Expand Down
4 changes: 2 additions & 2 deletions sportorg/models/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ def _index_bib(self, new_bib: int) -> None:
other_person = r.person_index_bib[new_bib]
if not other_person is self:
logging.info(
'Duplicate bib %s (do nothing): %s | %s',
'Duplicate bib %s: %s (indexed) | %s (not indexed)',
new_bib,
self,
other_person,
Expand Down Expand Up @@ -1452,7 +1452,7 @@ def _index_card(self, new_card):
other_person = r.person_index_card[new_card]
if not other_person is self:
logging.info(
'Duplicate card %s (do nothing): %s | %s',
'Duplicate card %s: %s (indexed) | %s (not indexed)',
new_card,
self,
other_person,
Expand Down
Loading