mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 06:17:07 +00:00
Detect unwriteable file permissions earlier
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user