From e6f7150b6fde2d086fdd02da288926c9616587be Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Sun, 14 Feb 2021 11:34:44 +0100
Subject: [PATCH] * Fixed #123 split RkiBundeslaenderService into two Services,
 one for bundeslaender and one for landkreise * Fixed #128 add fields from csv
 to RkiLandkreiseImport * Fixed #139 refactor RkiBundeslaenderServiceDownload
 to new method scheme introduced 07.02.2021 * Fixed #140 move WhoImport to RKI
 in: rk_service_import.py * Fixed #125 implement RkiLandkreise * Fixed #126
 implement RkiBundeslaenderImport

---
 src/covid19/blueprints/ecdc/ecdc_model.py          | 10 ++++------
 src/covid19/blueprints/ecdc/ecdc_service_update.py |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/covid19/blueprints/ecdc/ecdc_model.py b/src/covid19/blueprints/ecdc/ecdc_model.py
index e15b118b..bbed5139 100644
--- a/src/covid19/blueprints/ecdc/ecdc_model.py
+++ b/src/covid19/blueprints/ecdc/ecdc_model.py
@@ -6,9 +6,7 @@ from covid19.blueprints.application.application_model import ApplicationDateRepo
 
 class EcdcDateReported(ApplicationDateReported):
     __tablename__ = 'ecdc_date_reported'
-    __mapper_args__ = {
-        'concrete': True
-    }
+    __mapper_args__ = { 'concrete': True }
     __table_args__ = (
         db.UniqueConstraint('date_reported', 'datum', name="uix_ecdc_date_reported"),
     )
@@ -48,10 +46,10 @@ class EcdcDateReported(ApplicationDateReported):
 
     @classmethod
     def get_datum_parts(cls, my_date_rep: str):
-        my_date_parts = my_date_rep.split("/")
-        my_year = int(my_date_parts[2])
-        my_month = int(my_date_parts[1])
+        my_date_parts = my_date_rep.split('/')
         my_day = int(my_date_parts[0])
+        my_month = int(my_date_parts[1])
+        my_year = int(my_date_parts[2])
         datum_parts = (my_year, my_month, my_day)
         return datum_parts
 
diff --git a/src/covid19/blueprints/ecdc/ecdc_service_update.py b/src/covid19/blueprints/ecdc/ecdc_service_update.py
index 19132079..b6b09417 100644
--- a/src/covid19/blueprints/ecdc/ecdc_service_update.py
+++ b/src/covid19/blueprints/ecdc/ecdc_service_update.py
@@ -135,7 +135,7 @@ class EcdcServiceUpdate:
             )
             if my_ecdc_date_reported_obj is None:
                 my_ecdc_date_reported_obj = EcdcDateReported.create_new_object_factory(
-                    my_date_rep=my_date_reported_search_str
+                    my_date_rep=item_date_str_from_ecdc_import_str
                 )
                 db.session.add(my_ecdc_date_reported_obj)
                 db.session.commit()
-- 
GitLab