mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-10 16:02:33 +12:00
Fixes again: Crash when permissions don't allow saving #138
This commit is contained in:
parent
f160d7d1c2
commit
c7e6a2d53e
|
@ -296,7 +296,10 @@ def saveProject(zip=None):
|
|||
|
||||
project = mw.currentProject
|
||||
|
||||
if not os.access(project, os.W_OK):
|
||||
# We check if the file exist and we have write access. If the file does
|
||||
# not exists, we check the parent folder, because it might be a new project.
|
||||
if os.path.exists(project) and not os.access(project, os.W_OK) or \
|
||||
not os.path.exists(project) and not os.access(os.path.dirname(project), os.W_OK):
|
||||
print("Error: you don't have write access to save this project there.")
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue