Skip to content

Commit b45d5cb

Browse files
committed
Added office and pdf documents to the "aux files"
1 parent 485d085 commit b45d5cb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

exact/exact/images/api_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,9 @@ def create(self, request):
462462
path = Path(path)
463463
name = path.name
464464

465-
if (Path(path).suffix.lower().endswith(".csv") or Path(path).suffix.lower().endswith(".txt") or
465+
if (Path(path).suffix.lower().endswith(".pdf") or Path(path).suffix.lower().endswith(".docx") or Path(path).suffix.lower().endswith(".xlsx") or
466+
Path(path).suffix.lower().endswith(".doc") or Path(path).suffix.lower().endswith(".csv") or Path(path).suffix.lower().endswith(".txt") or
467+
Path(path).suffix.lower().endswith(".xls") or Path(path).suffix.lower().endswith(".pptx") or Path(path).suffix.lower().endswith(".ppt") or
466468
Path(path).suffix.lower().endswith(".json") or Path(path).suffix.lower().endswith(".sqlite")):
467469
# This is an auxiliary file, not an image.
468470
newFile = models.AuxiliaryFile(image_set=imageset, name=name, filesize=os.path.getsize(path))

exact/exact/images/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ def upload_image(request, imageset_id):
325325
path = Path(path)
326326
name = path.name
327327

328-
if (Path(path).suffix.lower().endswith(".csv") or Path(path).suffix.lower().endswith(".txt") or
328+
if (Path(path).suffix.lower().endswith(".pdf") or Path(path).suffix.lower().endswith(".docx") or Path(path).suffix.lower().endswith(".xlsx") or
329+
Path(path).suffix.lower().endswith(".doc") or Path(path).suffix.lower().endswith(".csv") or Path(path).suffix.lower().endswith(".txt") or
330+
Path(path).suffix.lower().endswith(".xls") or Path(path).suffix.lower().endswith(".pptx") or Path(path).suffix.lower().endswith(".ppt") or
329331
Path(path).suffix.lower().endswith(".json") or Path(path).suffix.lower().endswith(".sqlite")):
330332
# This is an auxiliary file, not an image.
331333

0 commit comments

Comments
 (0)