mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix os.chown call on Windows (#563)
This commit is contained in:
committed by
Raphael Michel
parent
83df4451e6
commit
921834c917
@@ -44,7 +44,10 @@ else:
|
|||||||
SECRET_KEY = get_random_string(50, chars)
|
SECRET_KEY = get_random_string(50, chars)
|
||||||
with open(SECRET_FILE, 'w') as f:
|
with open(SECRET_FILE, 'w') as f:
|
||||||
os.chmod(SECRET_FILE, 0o600)
|
os.chmod(SECRET_FILE, 0o600)
|
||||||
os.chown(SECRET_FILE, os.getuid(), os.getgid())
|
try:
|
||||||
|
os.chown(SECRET_FILE, os.getuid(), os.getgid())
|
||||||
|
except AttributeError:
|
||||||
|
pass # os.chown is not available on Windows
|
||||||
f.write(SECRET_KEY)
|
f.write(SECRET_KEY)
|
||||||
|
|
||||||
# Adjustable settings
|
# Adjustable settings
|
||||||
|
|||||||
Reference in New Issue
Block a user