CodeForAfrica / sensors.AFRICA-api

The sensors.AFRICA API receiving, storing, and processing data received from sensors across the continentent. Accessible at https://api.sensors.africa/
https://api.sensors.africa/
18 stars 7 forks source link

Fix sensorsafrica.tasks.archive_data #32

Closed karimkawambwa closed 5 years ago

karimkawambwa commented 5 years ago

Description

Fix FileNotFoundError

Fixes # (issue)

FileNotFoundError: [Errno 2] No such file or directory: './temp/february_2019_sensor_data_archive.csv'
  File "sensorsafrica/tasks.py", line 12, in archive_data
    call_command("upload_to_ckan")
  File "django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "sensorsafrica/management/commands/upload_to_ckan.py", line 100, in handle
    self._write_file(filepath=filepath, qs=qs)
  File "sensorsafrica/management/commands/upload_to_ckan.py", line 121, in _write_file
    with open(filepath, "w") as fp:

Type of change

Please delete options that are not relevant.

Screenshots

Screen Shot 2019-04-08 at 2 05 05 PM

Checklist: