add changes in mediagoblin/submit/views.py
authorJakob Kramer <jakob.kramer@gmx.de>
Thu, 2 Jun 2011 15:47:38 +0000 (17:47 +0200)
committerJakob Kramer <jakob.kramer@gmx.de>
Thu, 2 Jun 2011 15:47:53 +0000 (17:47 +0200)
mediagoblin/submit/views.py

index 262f2b12139b5fe1348e0976ffcc05487d8df885..5ddf992fd8ca6e0f438d8f3f7a346f639c1e8a37 100644 (file)
@@ -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