aboutsummaryrefslogtreecommitdiffstats
path: root/servo/forms
diff options
context:
space:
mode:
Diffstat (limited to 'servo/forms')
-rw-r--r--servo/forms/admin.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/servo/forms/admin.py b/servo/forms/admin.py
index e69c12e..e108bfe 100644
--- a/servo/forms/admin.py
+++ b/servo/forms/admin.py
@@ -167,7 +167,12 @@ class QueueForm(BaseModelForm):
def clean_order_template(self):
from servo.lib.utils import file_type
tpl = self.cleaned_data.get('order_template')
+
+ if tpl is None: # file was not uploaded
+ return
+
ftype = file_type(tpl.file.read())
+
if ftype != 'text/html':
raise forms.ValidationError(_('Print tempates must be in HTML format'))