Merge branch 'bug/cannot-create-server' into 'dev'

Fix error where user could not create server

See merge request crafty-controller/crafty-commander!211
This commit is contained in:
Andrew 2022-03-14 23:11:01 +00:00
commit 6659466427
3 changed files with 7 additions and 4 deletions

View File

@ -162,6 +162,10 @@ class Controller:
#we'll iterate through our list of log paths from auth servers.
for server in auth_servers:
final_path = os.path.join(server_path, str(server['server_name']))
try:
os.mkdir(final_path)
except FileExistsError:
final_path += '_'+server['server_uuid']
os.mkdir(final_path)
try:
file_helper.copy_file(server['log_path'], final_path)

View File

@ -184,7 +184,7 @@ class PanelHandler(BaseHandler):
# pylint: disable=unused-variable
api_key, token_data, exec_user = self.current_user
superuser = exec_user['superuser']
preparing = exec_user['preparing']
print()
if api_key is not None:
superuser = superuser and api_key.superuser
@ -255,7 +255,6 @@ class PanelHandler(BaseHandler):
'lang': self.controller.users.get_user_lang_by_id(exec_user["user_id"]),
'lang_page': helper.getLangPage(self.controller.users.get_user_lang_by_id(exec_user["user_id"])),
'super_user': superuser,
'preparing': preparing,
'api_key': {
'name': api_key.name,
'created': api_key.created,

View File

@ -32,7 +32,7 @@
{% end %}
<p class="font-weight-light text-muted mb-0">Email: {{ data['user_data']['email'] }}</p>
</div>
{% if data['preparing'] %}
{% if data['user_data']['preparing'] %}
<span class="dropdown-item" id="support_progress"><i class="dropdown-item-icon mdi mdi-download-outline text-primary"></i>{{ translate('notify', 'supportLogs', data['lang']) }}<br><br></span>
<span class="dropdown-item" id="support_progress"><div class="support_progress" style="height: 15px; width: 100%;">
<div class="progress-bar progress-bar-striped progress-bar-animated" id="logs_progress_bar" role="progressbar" style="width:0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>