General refactor to remove stuff being passed around the Tornado handlers when it doesn't need to be. Conditions provider presence is how handled on the JS side without needing special booleans sent to every page handler.

This commit is contained in:
Ian Renton
2026-06-09 11:06:48 +01:00
parent cd30fc765b
commit b725c34f7c
14 changed files with 281 additions and 281 deletions

View File

@@ -11,12 +11,9 @@ from core.prometheus_metrics_handler import page_requests_counter
class PageTemplateHandler(tornado.web.RequestHandler):
"""Handler for all HTML pages generated from templates"""
def initialize(self, template_name, web_server_metrics, has_hamqsl=False, has_noaa_forecast=False, has_giro_ionosonde=False):
def initialize(self, template_name, web_server_metrics):
self._template_name = template_name
self._web_server_metrics = web_server_metrics
self._has_hamqsl = has_hamqsl
self._has_noaa_forecast = has_noaa_forecast
self._has_giro_ionosonde = has_giro_ionosonde
def get(self):
# Metrics
@@ -28,6 +25,4 @@ class PageTemplateHandler(tornado.web.RequestHandler):
# Load named template, and provide variables used in templates
self.render(self._template_name + ".html", software_version=SOFTWARE_VERSION,
server_owner_callsign=SERVER_OWNER_CALLSIGN, allow_spotting=ALLOW_SPOTTING,
web_ui_options=WEB_UI_OPTIONS, baseurl=BASE_URL, current_path=self.request.path,
has_hamqsl=self._has_hamqsl, has_noaa_forecast=self._has_noaa_forecast,
has_giro_ionosonde=self._has_giro_ionosonde)
web_ui_options=WEB_UI_OPTIONS, baseurl=BASE_URL, current_path=self.request.path)