summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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