diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-10-03 03:33:13 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-10-03 03:33:13 (GMT) |
commit | d742d88416b8b6e9bf76cd8df2346acab5ff29c6 (patch) | |
tree | 4277338409556baf85b54e8c399828efd2e723f1 /webapp/polls/views.py | |
parent | 0ae2ebc622d11d227052b952b51c1a43907d66bc (diff) |
Refactor: UploadPollResultFormView uses exists method for each poll result file
Diffstat (limited to 'webapp/polls/views.py')
-rw-r--r-- | webapp/polls/views.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/webapp/polls/views.py b/webapp/polls/views.py index 167e4ef..578d137 100644 --- a/webapp/polls/views.py +++ b/webapp/polls/views.py @@ -380,13 +380,10 @@ class UnploadPollResultFormView(TemplateView): # Esto hace todo # comprueba si los archivos ya existÃan y los excluye - poll_id = to_json[0].get("poll_id", None) - results_path = "%s/%s" % (settings.RESULT_BCK_ROOT, poll_id) uploaded_files = [] for index, file in enumerate(valid_files): prf = PollResultFile(file.temporary_file_path()) - file_path = "%s/%s" % (results_path, file.name) - if os.path.exists(file_path) or not prf.validate(): + if prf.exists() or not prf.validate(): uploaded_files.append(file.name) del valid_files[index] |