Skip to content

Commit

Permalink
third time is the charm
Browse files Browse the repository at this point in the history
  • Loading branch information
lstillwe committed Mar 12, 2024
1 parent cc2b00b commit 4d4625e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,10 @@ async def get_station_data_file(file_name: Union[str, None] = Query(default='sta
os.makedirs(temp_file_path)

# write out the data to a file
with open(file_path, 'w', encoding='utf-8') as f_h:
json.dump(ret_val, f_h)
reader = csv.reader(ret_val.splitlines(), skipinitialspace=True)
with open(file_path, 'w') as f_h:
writer = csv.writer(f_h)
writer.writerows(reader)
else:
# set the error message
ret_val = 'Error Invalid input. Insure that all input fields are populated.'
Expand Down

0 comments on commit 4d4625e

Please sign in to comment.