From 1bac7666dc06b556971510a9339f069442b3e6c9 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 23 Oct 2013 16:17:47 +0530 Subject: minor change --- scipy/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scipy/views.py') 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 -- cgit