diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-12-10 09:01:09 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-12-10 09:01:09 +0200 |
commit | ede4b92846696806eeff5324da7b31196aee108f (patch) | |
tree | 8bc15706ebd0f0a995d65c51b9c997418395b846 /servo/forms | |
parent | e524535756b3a6dafd026161d440e3d6a94ab248 (diff) | |
download | Servo-ede4b92846696806eeff5324da7b31196aee108f.tar.gz Servo-ede4b92846696806eeff5324da7b31196aee108f.tar.bz2 Servo-ede4b92846696806eeff5324da7b31196aee108f.zip |
Don't check file type if not uploaded
Diffstat (limited to 'servo/forms')
-rw-r--r-- | servo/forms/admin.py | 5 |
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')) |