From 8b897ec1b5d006c0dd7dd252d60065507465d290 Mon Sep 17 00:00:00 2001
From: Tim Kreuzer <t.kreuzer@fz-juelich.de>
Date: Mon, 28 Apr 2025 14:26:18 +0200
Subject: [PATCH] update new frontend handler

---
 jsc_custom/apihandler/frontend.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/jsc_custom/apihandler/frontend.py b/jsc_custom/apihandler/frontend.py
index 2cfa684..97e0801 100644
--- a/jsc_custom/apihandler/frontend.py
+++ b/jsc_custom/apihandler/frontend.py
@@ -14,7 +14,7 @@ from .misc import NoXSRFCheckAPIHandler
 class FHostnameAPIHandler(NoXSRFCheckAPIHandler):
     async def get(self):
         self.set_header("Cache-Control", "no-cache")
-        self.write(jhub_hostname)
+        self.write(jhub_hostname.encode())
         self.set_status(200)
         return
 
@@ -122,6 +122,8 @@ class FUserOptionsAPIHandler(NoXSRFCheckAPIHandler):
         user = self.current_user
         if user is not None:
             user_options = await async_decrypted_user_options(user)
+            if "" in user_options.keys():
+                del user_options[""]
             self.write(json.dumps(user_options))
         self.set_status(200)
         return
@@ -145,7 +147,10 @@ class FUserAPIHandler(NoXSRFCheckAPIHandler):
         ret["backendServices"] = (custom_config.get("backendServices", {}),)
         ret["incidents"] = get_incidents(user)
         ret["reservations"] = (get_reservations(),)
-        ret["decrypted_user_options"] = await async_decrypted_user_options
+        user_options = await async_decrypted_user_options(user)
+        if "" in user_options.keys():
+            del user_options[""]
+        ret["decrypted_user_options"] = user_options
         self.write(json.dumps(ret))
         self.set_status(200)
         return
-- 
GitLab