diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-12-05 17:45:45 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-12-05 17:45:45 +0000 |
commit | bb97b7c862088e09e29f212e8ca124271f806cca (patch) | |
tree | 1934a0013439015116fd38c8221c40cf03fed0db /core/views/survex.py | |
parent | 1aef81dccc80be190f999b95e26236867fdbedfa (diff) | |
download | troggle-bb97b7c862088e09e29f212e8ca124271f806cca.tar.gz troggle-bb97b7c862088e09e29f212e8ca124271f806cca.tar.bz2 troggle-bb97b7c862088e09e29f212e8ca124271f806cca.zip |
Catch permissions error.
Diffstat (limited to 'core/views/survex.py')
-rw-r--r-- | core/views/survex.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/views/survex.py b/core/views/survex.py index 09bb434..9b6fc18 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -147,6 +147,8 @@ class SvxForm(forms.Form): if not os.path.exists(newpath): os.makedirs(newpath) fout = open(fname, "wt", encoding='utf8',newline='\n') + except PermissionError: + return "CANNOT save this file.\nPERMISSIONS incorrectly set on server for this file. Ask a nerd to fix this." # javascript seems to insert CRLF on WSL1 whatever you say. So fix that: res = fout.write(rcode.replace("\r","")) |