Skip to content

Commit

Permalink
refactor: flake8 helped me see this
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Jun 21, 2023
1 parent bbccf6f commit d973e30
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions flexmeasures/cli/data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,14 +1256,12 @@ def add_report( # noqa: C901
to the database or export them as CSV or Excel file.
"""

# parse timezone into a BaseTzInfo object
if timezone is None:
timezone = sensor.timezone
if isinstance(timezone, str):
# compute now in the timezone local to the output sensor
if timezone is not None:
check_timezone(timezone)
timezone = pytz.timezone(zone=timezone)

now = timezone.localize(datetime.now())
now = pytz.timezone(
zone=timezone if timezone is not None else sensor.timezone
).localize(datetime.now())

# apply offsets, if provided
if start_offset is not None:
Expand Down

0 comments on commit d973e30

Please sign in to comment.