diff --git a/src/covid19/blueprints/who/who_model_import.py b/src/covid19/blueprints/who/who_model_import.py index 3fc0e2b41622ddfa7a9a5198dc935ee12539e794..4db10ce746df9cd7ec2f45a164d92e086910ee9d 100644 --- a/src/covid19/blueprints/who/who_model_import.py +++ b/src/covid19/blueprints/who/who_model_import.py @@ -69,7 +69,8 @@ class WhoImport(db.Model): .group_by(cls.date_reported)\ .distinct().all() for item, in myresultset: - pass + if not item in myresultarray: + myresultarray.append(item) return myresultarray @classmethod diff --git a/src/covid19/blueprints/who/who_service_update.py b/src/covid19/blueprints/who/who_service_update.py index f53cbbc1cb301161b75961c6a6e92de439dfadac..be9747d3bcbb35e0053a89465392aa6aef0b80f3 100644 --- a/src/covid19/blueprints/who/who_service_update.py +++ b/src/covid19/blueprints/who/who_service_update.py @@ -22,7 +22,7 @@ class WhoServiceUpdateFull(WhoServiceUpdateBase): app.logger.info("------------------------------------------------------------") WhoDateReported.remove_all() i = 0 - for i_date_reported, in WhoImport.get_dates_reported_as_array(): + for i_date_reported, in WhoImport.get_dates_reported(): i += 1 output = " [ " + str(i) + " ] " + i_date_reported o = WhoDateReported.create_new_object_factory(my_date_rep=i_date_reported) @@ -85,6 +85,7 @@ class WhoServiceUpdateFull(WhoServiceUpdateBase): def __full_update_data(self): app.logger.info(" WhoServiceUpdateFull.__full_update_data [begin]") app.logger.info("------------------------------------------------------------") + WhoData.remove_all() new_dates_reported_from_import = WhoImport.get_dates_reported_as_array() i = 0 for my_date_reported in new_dates_reported_from_import: