From 223995b5f67933a5c5165adddd7617e6fd41cee5 Mon Sep 17 00:00:00 2001 From: Adam Coddington Date: Mon, 16 Jan 2023 12:46:58 -0800 Subject: [PATCH] [#147] Minor style fixes. --- myfitnesspal/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/myfitnesspal/client.py b/myfitnesspal/client.py index dd93ca7..8e426a0 100644 --- a/myfitnesspal/client.py +++ b/myfitnesspal/client.py @@ -704,8 +704,10 @@ def get_report( """ Returns report data of a given name and category between two dates. """ - if (datetime.date.today()-lower_bound).days > 80: - logger.warning(f"Report API may not be able to look back this far. Some results may be incorrect.") + if lower_bound and ((datetime.date.today() - lower_bound).days > 80): + logger.warning( + "Report API may not be able to look back this far. Some results may be incorrect." + ) upper_bound, lower_bound = self._ensure_upper_lower_bound( lower_bound, upper_bound