From ff4a270668da04af6020f0354afc7c718df61c06 Mon Sep 17 00:00:00 2001
From: Tim Kreuzer <t.kreuzer@fz-juelich.de>
Date: Wed, 9 Apr 2025 08:52:52 +0200
Subject: [PATCH] use r2drepourl as default name

---
 jsc_custom/handler/share_handler.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/jsc_custom/handler/share_handler.py b/jsc_custom/handler/share_handler.py
index 17a600e..f8a0b50 100644
--- a/jsc_custom/handler/share_handler.py
+++ b/jsc_custom/handler/share_handler.py
@@ -139,13 +139,15 @@ class R2DHandler(SpawnHandler):
 
         args_unquote = [urllib.parse.unquote(x) for x in args]
         user_options["repo2docker"]["repotype"] = repotype
+        user_options["repo2docker"]["repourl"] = "/".join(args_unquote)
 
         if len(arguments_dict_lower.get("name", [])) > 0:
             user_options["name"] = arguments_dict_lower.get("name")[0].decode("utf-8")
         else:
-            user_options["name"] = "Unnamed"
-
-        user_options["repo2docker"]["repourl"] = "/".join(args_unquote)
+            if repotype == "gh":
+                user_options["name"] = args_unquote[0]
+            else:
+                user_options["name"] = user_options["repo2docker"]["repourl"]
 
         # if "labpath" in self.request.arguments
         if len(arguments_dict_lower.get("labpath", [])) > 0:
-- 
GitLab