summaryrefslogtreecommitdiffstats
path: root/core/views/uploads.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/uploads.py')
-rw-r--r--core/views/uploads.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py
index 2f3e053..6819e3d 100644
--- a/core/views/uploads.py
+++ b/core/views/uploads.py
@@ -109,12 +109,12 @@ def dwgupload(request, folder=None, gitdisable='no'):
We use get_or_create instead of simply creating a new object in case someone uploads the same file
several times in one session, and expects them to be overwritten in the database. Although
- the actual file will be duplicated in the filesystem with different random name ammendation.
+ the actual file will be duplicated in the filesystem with different random name ending.
'''
def dwgvalid(name):
- if name in [ '.gitignore', '.hgignore', ]:
+ if name in [ '.gitignore', ]:
return False
- if Path(name).suffix.lower() in ['.xml', '.th', '.th2', '', '.svg', '.jpg', '.pdf', 'jpeg']:
+ if Path(name).suffix.lower() in ['.xml', '.th', '.th2', '', '.svg', '.jpg', '.pdf', '.jpeg', '.txt']:
return True # dangerous, we should check the actual file binary signature
return False
@@ -163,10 +163,11 @@ def dwgupload(request, folder=None, gitdisable='no'):
dwgfile.save()
else:
refused.append(f.name)
+ print(f'REFUSED {f.name}')
if actual_saved: # maybe all were refused by the suffix test in dwgvalid()
filesaved = True
if gitdisable != 'yes':
- subprocess.call([git, "commit", "-m", 'dwgupload'], cwd=dirpath)
+ subprocess.call([git, "commit", "-m", f'Drawings upload - {list(multiple)}'], cwd=dirpath)
files = []