mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
make sure report entries are actually saved
This commit is contained in:
parent
3c76a82997
commit
b2e0c51ead
@ -14,6 +14,7 @@ from mealie.schema.reports.reports import (
|
|||||||
ReportCategory,
|
ReportCategory,
|
||||||
ReportCreate,
|
ReportCreate,
|
||||||
ReportEntryCreate,
|
ReportEntryCreate,
|
||||||
|
ReportEntryOut,
|
||||||
ReportOut,
|
ReportOut,
|
||||||
ReportSummary,
|
ReportSummary,
|
||||||
ReportSummaryStatus,
|
ReportSummaryStatus,
|
||||||
@ -91,6 +92,7 @@ class BaseMigrator(BaseService):
|
|||||||
is_success = True
|
is_success = True
|
||||||
is_failure = True
|
is_failure = True
|
||||||
|
|
||||||
|
new_entries: list[ReportEntryOut] = []
|
||||||
for entry in self.report_entries:
|
for entry in self.report_entries:
|
||||||
if is_failure and entry.success:
|
if is_failure and entry.success:
|
||||||
is_failure = False
|
is_failure = False
|
||||||
@ -98,7 +100,7 @@ class BaseMigrator(BaseService):
|
|||||||
if is_success and not entry.success:
|
if is_success and not entry.success:
|
||||||
is_success = False
|
is_success = False
|
||||||
|
|
||||||
self.db.group_report_entries.create(entry)
|
new_entries.append(self.db.group_report_entries.create(entry))
|
||||||
|
|
||||||
if is_success:
|
if is_success:
|
||||||
self.report.status = ReportSummaryStatus.success
|
self.report.status = ReportSummaryStatus.success
|
||||||
@ -109,6 +111,7 @@ class BaseMigrator(BaseService):
|
|||||||
if not is_success and not is_failure:
|
if not is_success and not is_failure:
|
||||||
self.report.status = ReportSummaryStatus.partial
|
self.report.status = ReportSummaryStatus.partial
|
||||||
|
|
||||||
|
self.report.entries = new_entries
|
||||||
self.db.group_reports.update(self.report.id, self.report)
|
self.db.group_reports.update(self.report.id, self.report)
|
||||||
|
|
||||||
def migrate(self, report_name: str) -> ReportSummary:
|
def migrate(self, report_name: str) -> ReportSummary:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user