From: Jakob Kramer Date: Thu, 2 Jun 2011 15:47:38 +0000 (+0200) Subject: add changes in mediagoblin/submit/views.py X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3eeadc922a669af9b4df4a41dc464bf6587802c1;p=mediagoblin.git add changes in mediagoblin/submit/views.py --- diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 262f2b12..5ddf992f 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -21,7 +21,7 @@ from webob import Response, exc from werkzeug.utils import secure_filename from mediagoblin.decorators import require_active_login -from mediagoblin.submit import forms as submit_forms +from mediagoblin.submit import forms as submit_forms, security from mediagoblin.process_media import process_media_initial @@ -38,6 +38,9 @@ def submit_start(request): and request.POST['file'].file): submit_form.file.errors.append( u'You must provide a file.') + elif not security.check_filetype(request.POST['file']): + submit_form.file.errors.append( + u'The file doesn\'t seem to be an image!') else: filename = request.POST['file'].filename