diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-12-30 20:08:24 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-12-30 20:08:24 +0000 |
commit | 4470c5abbd165597dbdba29ae9f830d4170ae428 (patch) | |
tree | 33d767bb267afbcb70147287984c2f6300cbf3b0 | |
parent | c3a54858d5bd253186eb3d318a58a240137f8a10 (diff) | |
download | troggle-4470c5abbd165597dbdba29ae9f830d4170ae428.tar.gz troggle-4470c5abbd165597dbdba29ae9f830d4170ae428.tar.bz2 troggle-4470c5abbd165597dbdba29ae9f830d4170ae428.zip |
chmod after write
-rw-r--r-- | core/models/caves.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index 4ecbfdb..9b3e5b0 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -50,9 +50,9 @@ def writetrogglefile(filepath, filecontent): # do not trap exceptions, pass them up to the view that called this function # if the os.chmod fails, it can zero the contents of the file as a side effect. Dangerous. with open(filepath, "w") as f: - f.chmod(0o664) # safely set file permissions to rw-rw-r-- - # os.chmod(filepath, 0o664) # set file permissions to rw-rw-r-- f.write(filecontent) + filepath.chmod(0o664) # set file permissions to rw-rw-r-- + # os.chmod(filepath, 0o664) # set file permissions to rw-rw-r-- print(f'WRITING{cwd}---{filename} ') call([git, "add", filename], cwd=cwd) call([git, "commit", "-m", 'Online cave or entrance edit'], cwd=cwd) |