[chronojump] Fixes bug when importing a session where personIDs would already exist in the current database.



commit f00257802d47356123350016deda040279cc0206
Author: Carles Pina i Estany <carles pina cat>
Date:   Thu Dec 1 10:46:58 2016 +0000

    Fixes bug when importing a session where personIDs would already exist in the current database.
    
    The bug was that personSession wouldn't be imported. Now it avoids the
    duplicates but making sure that this personID exists for the current
    session (before it didn't import the personSession if the personID
    existed in the database (!))
    
    Pending: unit tests

 src/chronojump-importer/chronojump_importer.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index 4ac38dc..1b6ccd9 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -551,7 +551,7 @@ class ImportSession:
 
         # Inserts the person_session_77 table but not for personsIDs that already existed in this session. 
This is
         # the case if a user imports a session into an existing session and the persons would be already 
imported.
-        self.destination_db.write(table=person_session_77, matches_columns=["personID"])
+        self.destination_db.write(table=person_session_77, matches_columns=["sessionID", "personID"])
 
     def _import_encoder(self):
         # Imports EncoderExercise


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]