Commit 287a3f5db24607b9bd170e26f3a103fe0b5236b6
1 parent
348c1525
Exists in
master
and in
39 other branches
Checking if data was extract from file b4 sending to template
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
src/accounts/views.py
src/proxy/search_indexes.py
... | ... | @@ -50,9 +50,13 @@ class AttachmentIndex(BaseIndex, indexes.Indexable): |
50 | 50 | logger.warning(u'IOError: %s - %s', e.strerror, e.filename) |
51 | 51 | return data |
52 | 52 | backend = self._get_backend(None) |
53 | + | |
53 | 54 | extracted_data = backend.extract_file_contents(file_obj) |
54 | 55 | file_obj.close() |
55 | 56 | |
57 | + if not extracted_data: | |
58 | + return data | |
59 | + | |
56 | 60 | t = loader.select_template( |
57 | 61 | ('search/indexes/proxy/attachment_text.txt', ) |
58 | 62 | ) | ... | ... |