From abbbf5469916ca5aebc1bdda159573c8470aaa9f Mon Sep 17 00:00:00 2001
From: Tim Kreuzer <t.kreuzer@fz-juelich.de>
Date: Mon, 11 Mar 2024 18:06:05 +0100
Subject: [PATCH] forward unicore update if spawner has currently no start_id

---
 unicorespawner/api_notifications.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/unicorespawner/api_notifications.py b/unicorespawner/api_notifications.py
index b08f623..7959334 100644
--- a/unicorespawner/api_notifications.py
+++ b/unicorespawner/api_notifications.py
@@ -25,7 +25,8 @@ class SpawnEventsUnicoreAPIHandler(APIHandler):
 
         spawner = user.spawners[server_name]
 
-        if spawner.start_id != start_id:
+        if spawner.start_id and spawner.start_id != start_id:
+            # If the spawner has currently a start_id and it's different, then we don't forward the given update
             self.log.warning(
                 f"{spawner._log_name} - Spawner unique start id ({spawner.start_id}) does not match given id ({start_id}). Do not update Spawner"
             )
-- 
GitLab