mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-20 18:25:29 +01:00
28 lines
711 B
Python
28 lines
711 B
Python
from app.classes.web.base_api_handler import BaseApiHandler
|
|
|
|
|
|
class ApiCraftyJarCacheIndexHandler(BaseApiHandler):
|
|
def get(self):
|
|
auth_data = self.authenticate_user()
|
|
if not auth_data:
|
|
return
|
|
(
|
|
_,
|
|
_,
|
|
_,
|
|
_,
|
|
_,
|
|
) = auth_data
|
|
|
|
if not auth_data[4]["superuser"]:
|
|
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
|
|
|
self.controller.server_jars.manual_refresh_cache()
|
|
self.finish_json(
|
|
200,
|
|
{
|
|
"status": "ok",
|
|
"data": self.controller.server_jars.get_serverjar_data(),
|
|
},
|
|
)
|