summaryrefslogtreecommitdiff
path: root/scipy/views.py
diff options
context:
space:
mode:
authorhardythe12013-10-23 16:17:47 +0530
committerhardythe12013-10-23 16:17:47 +0530
commit1bac7666dc06b556971510a9339f069442b3e6c9 (patch)
tree129bd5c4400805937091fbd03f5dfd75fe048dca /scipy/views.py
parent111ff5e2e333353d5d46bd924ac95d52adeece38 (diff)
downloadSciPy2013-1bac7666dc06b556971510a9339f069442b3e6c9.tar.gz
SciPy2013-1bac7666dc06b556971510a9339f069442b3e6c9.tar.bz2
SciPy2013-1bac7666dc06b556971510a9339f069442b3e6c9.zip
minor change
Diffstat (limited to 'scipy/views.py')
-rw-r--r--scipy/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scipy/views.py b/scipy/views.py
index 28b2f35..b6d9d8c 100644
--- a/scipy/views.py
+++ b/scipy/views.py
@@ -88,8 +88,9 @@ def upload_document(request):
if request.user.is_authenticated():
if request.method == 'POST':
form = DocumentUploadForm(request.POST, request.FILES)
- content_type = request.FILES['attachments'].content_type.split('/')[1]
- content_size = request.FILES['attachments'].size
+ attachment = request.FILES['attachments']
+ content_type = attachment.split('/')[1]
+ content_size = attachment.size
if not content_type in allowed_files:
invalid_file_msg = "Only PDF, DOC, DOCX & TXT files are allowed"
context['invalid_file'] = invalid_file_msg