backend: Add None-checks with assertions and if-elses.

This fixes a batch of mypy errors of the following format:
'Item "None" of "Optional[Something]" has no attribute "abc"'
This commit is contained in:
PIG208
2021-07-25 00:16:48 +08:00
committed by Tim Abbott
parent fffd4ed8d5
commit 66b1a4e7ca
15 changed files with 55 additions and 24 deletions

View File

@@ -60,6 +60,7 @@ class Command(BaseCommand):
return
fill_to_time = parse_datetime(options["time"])
assert fill_to_time is not None
if options["utc"]:
fill_to_time = fill_to_time.replace(tzinfo=timezone.utc)
if fill_to_time.tzinfo is None: