mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 12:27:05 +00:00
remove chmod attempt
This commit is contained in:
@@ -312,15 +312,18 @@ def editexpopage(request, path):
|
||||
git = settings.GIT
|
||||
try:
|
||||
with open(filepath, "w") as f:
|
||||
os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
|
||||
f.write(result)
|
||||
print(f'WRITING{cwd}---{filename} ')
|
||||
# as the wsgi process www-data, we have group write-access but are not owner, so cannot chmod.
|
||||
# os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
|
||||
# see also core/models/cave.py writetrogglefile()
|
||||
f.write(result)
|
||||
# should replace .call with .run and capture_output=True
|
||||
subprocess.call([git, "add", filename], cwd=cwd)
|
||||
subprocess.call([git, "commit", "-m", 'Edit this page'], cwd=cwd)
|
||||
except PermissionError:
|
||||
message = f'CANNOT save this file.\nPERMISSIONS incorrectly set on server for this file {filename}. Ask a nerd to fix this.'
|
||||
return render(request,'errors/generic.html', {'message': message})
|
||||
except:
|
||||
except SubprocessError:
|
||||
message = f'CANNOT git on server for this file {filename}. Edits not saved.\nAsk a nerd to fix this.'
|
||||
return render(request,'errors/generic.html', {'message': message})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user