diff --git a/polling_stations/apps/data_importers/base_importers.py b/polling_stations/apps/data_importers/base_importers.py index b37b128da1..decc20a207 100644 --- a/polling_stations/apps/data_importers/base_importers.py +++ b/polling_stations/apps/data_importers/base_importers.py @@ -166,16 +166,12 @@ def report(self): # save a static copy in the DB that we can serve up on the website record = DataQuality.objects.get_or_create(council_id=self.council.pk) - record[0].report = report.generate_string_report() record[0].num_stations = station_report.get_stations_imported() record[0].num_districts = district_report.get_districts_imported() record[0].num_addresses = address_report.get_addresses_with_station_id() - + record[0].report = report.generate_string_report() record[0].save() - # output to console - report.output_console_report() - @property def data_path(self): if getattr(settings, "PRIVATE_DATA_PATH", None): diff --git a/polling_stations/apps/data_importers/data_quality_report.py b/polling_stations/apps/data_importers/data_quality_report.py index 65e14260ef..ee0c8100ba 100644 --- a/polling_stations/apps/data_importers/data_quality_report.py +++ b/polling_stations/apps/data_importers/data_quality_report.py @@ -484,12 +484,7 @@ def build_report(self): self.report.add_row(self.build_station_report()) self.report.add_row(self.build_address_report()) - def output_console_report(self): - console = Console() - console.print(self.report) - def generate_string_report(self): recorder = Console(record=True) - with recorder.capture(): - recorder.print(self.report) + recorder.print(self.report) return recorder.export_text() diff --git a/requirements/base.txt b/requirements/base.txt index 1e695d1e78..645075fcf4 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -20,7 +20,7 @@ pyshp==2.2.0 raven==6.10.0 requests==2.27.1 retry==0.9.2 -rich==12.0.0 +rich==12.2.0 rtree==0.9.7 boto==2.49.0 boto3==1.21.38