Fixed write settings command for Windows portable version. Fixed #2947.

This commit is contained in:
Norman Jäckel 2017-02-15 17:07:59 +01:00
parent 802e253621
commit 1a53c7c3cc

View File

@ -253,7 +253,10 @@ def write_settings(settings_path=None, template=None, **context):
os.makedirs(settings_module) os.makedirs(settings_module)
with open(settings_path, 'w') as settings_file: with open(settings_path, 'w') as settings_file:
settings_file.write(content) settings_file.write(content)
openslides_user_data_path = context['openslides_user_data_path'].strip("'") if context['openslides_user_data_path'] == 'get_win32_portable_user_data_path()':
openslides_user_data_path = get_win32_portable_user_data_path()
else:
openslides_user_data_path = context['openslides_user_data_path'].strip("'")
os.makedirs(os.path.join(openslides_user_data_path, 'static'), exist_ok=True) os.makedirs(os.path.join(openslides_user_data_path, 'static'), exist_ok=True)
return os.path.realpath(settings_path) return os.path.realpath(settings_path)