diff --git a/csv_uploader/views.py b/csv_uploader/views.py index d85d07c..0093af1 100644 --- a/csv_uploader/views.py +++ b/csv_uploader/views.py @@ -29,6 +29,8 @@ def post(self, request, *args, **kwargs): if not request.user.is_authenticated(): return HttpResponse("Access Denied..", content_type='text/plain') try: + if not (request.FILES['csv_file'].name.endswith('.csv')): + raise Exception("File type not matched. Please ensure to upload only CSV files") handler = CsvHandler(str(request.POST['action_name']), request.FILES['csv_file']) handler.process(request.user) diff --git a/setup.py b/setup.py index 48f481f..529a0c0 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import find_packages, setup -VERSION = (1, 0, 11) +VERSION = (1, 0, 14) __version__ = ".".join(str(i) for i in VERSION)