From 98f2848dc4618e8f5373bcdf2b85dac3ee28db0c Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sat, 5 Dec 2015 14:27:15 +0200 Subject: Only accept HTML order templates --- servo/lib/utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'servo/lib') diff --git a/servo/lib/utils.py b/servo/lib/utils.py index 6644a7e..2994fb3 100644 --- a/servo/lib/utils.py +++ b/servo/lib/utils.py @@ -8,6 +8,11 @@ from django.core.serializers.json import DjangoJSONEncoder from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger +def file_type(buf): + import magic + return magic.from_buffer(buf, mime=True) + + def paginate(queryset, page, count=10): """ Shortcut for paginating a queryset -- cgit v1.2.3