diff --git a/core/models/caves.py b/core/models/caves.py index 6a07748..0a4cc3e 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -42,7 +42,8 @@ def writetrogglefile(filepath, filecontent): '''Set permissions to rw-rw-r-- and commit the new saved file to git Callers to cave.writeDataFile() or entrance.writeDataFile() should handle the exception PermissionsError explicitly ''' - # see also core/views/expo.py editexpopage() + # GIT see also core/views/expo.py editexpopage() + # GIT see also core/views/uploads.py dwgupload() filepath = Path(filepath) cwd = filepath.parent filename = filepath.name @@ -56,7 +57,7 @@ def writetrogglefile(filepath, filecontent): #os.chmod(filepath, 0o664) # set file permissions to rw-rw-r-- # should replace .call with .run and capture_output=True call([git, "add", filename], cwd=cwd) - call([git, "commit", "-m", 'Troggle online cave or entrance edit'], cwd=cwd) + call([git, "commit", "-m", f'Troggle online: cave or entrance edit -{filename}'], cwd=cwd) class Area(TroggleModel): diff --git a/core/views/expo.py b/core/views/expo.py index 3a89269..c6ef01b 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -142,7 +142,7 @@ def expowebpage(request, expowebpath, path): if m: editable = False else: - editable = True + editable = os.access(Path(expowebpath / path), os.W_OK) # are file permissions writeable? has_menu = False menumatch = re.match(r'(.*)