forked from CGM_Public/pretix_original
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)
|
||||
with open(SECRET_FILE, 'w') as f:
|
||||
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)
|
||||
|
||||
# Adjustable settings
|
||||
|
||||
Reference in New Issue
Block a user