modilabs/formhub — Issue #133: Check XLS exists on XLS download
Author: pld
Created: 2012-02-02 03:09:27+00:00
State: open

Return a warning when XLS does not exists and not an error like this:

```
Traceback (most recent call last):

File "/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/home/wsgi/srv/ei_surveyor_alpha/formhub/odk_logger/views.py", line 110, in download_xlsform
path = os.path.join('media', xform.xls.path)

File "/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/db/models/fields/files.py", line 64, in _get_path
self._require_file()

File "/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/db/models/fields/files.py", line 47, in _require_file
raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)

ValueError: The 'xls' attribute has no file associated with it.
```