mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Make call to controller and not stale object
This commit is contained in:
parent
0ed4347254
commit
e99cacfc53
@ -273,7 +273,9 @@ class ServersController(metaclass=Singleton):
|
||||
latest = srv.stats_helper.get_latest_server_stats()
|
||||
server_data.append(
|
||||
{
|
||||
"server_data": server["server_data_obj"],
|
||||
"server_data": ServersController.get_server_data_by_id(
|
||||
server.get("server_id")
|
||||
),
|
||||
"stats": latest,
|
||||
"user_command_permission": True,
|
||||
}
|
||||
@ -328,7 +330,9 @@ class ServersController(metaclass=Singleton):
|
||||
user_command_permission = False
|
||||
server_data.append(
|
||||
{
|
||||
"server_data": DatabaseShortcuts.get_data_obj(server.server_object),
|
||||
"server_data": ServersController.get_server_data_by_id(
|
||||
server.server_id
|
||||
),
|
||||
"stats": latest,
|
||||
"user_command_permission": user_command_permission,
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import json
|
||||
import logging
|
||||
import threading
|
||||
import bleach
|
||||
from app.classes.controllers.servers_controller import ServersController
|
||||
import libgravatar
|
||||
import requests
|
||||
import tornado.web
|
||||
@ -258,7 +259,7 @@ class PanelHandler(BaseHandler):
|
||||
for server in defined_servers[:]:
|
||||
if str(server.server_id) == str(server_id):
|
||||
page_servers.append(
|
||||
DatabaseShortcuts.get_data_obj(server.server_object)
|
||||
ServersController.get_server_data_by_id(server.server_id)
|
||||
)
|
||||
user_order.remove(server_id)
|
||||
defined_servers.remove(server)
|
||||
@ -267,7 +268,7 @@ class PanelHandler(BaseHandler):
|
||||
server_ids.append(str(server.server_id))
|
||||
if server not in page_servers:
|
||||
page_servers.append(
|
||||
DatabaseShortcuts.get_data_obj(server.server_object)
|
||||
ServersController.get_server_data_by_id(server.server_id)
|
||||
)
|
||||
|
||||
for server_id in user_order[:]:
|
||||
|
Loading…
Reference in New Issue
Block a user