Skip to content

Commit f2740d7

Browse files
committed
Removes random colors
1 parent 711e82d commit f2740d7

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

jupyter_server/auth/identity.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from jupyter_server.transutils import _i18n
2626

2727
from .security import passwd_check, set_password
28-
from .utils import get_anonymous_username, get_random_color
28+
from .utils import get_anonymous_username
2929

3030
# circular imports for type checking
3131
if TYPE_CHECKING:
@@ -468,7 +468,7 @@ def generate_anonymous_user(self, handler: JupyterHandler) -> User:
468468
moon = get_anonymous_username()
469469
name = display_name = f"Anonymous {moon}"
470470
initials = f"A{moon[0]}"
471-
color = get_random_color()
471+
color = None
472472
handler.log.info(f"Generating new user for token-authenticated request: {user_id}")
473473
return User(user_id, name, display_name, initials, None, color)
474474

jupyter_server/auth/utils.py

-17
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,3 @@ def get_anonymous_username() -> str:
167167
This function returns names like "Anonymous Io" or "Anonymous Metis".
168168
"""
169169
return moons_of_jupyter[random.randint(0, len(moons_of_jupyter) - 1)]
170-
171-
172-
# Using JupyterLab CSS variable because the colors may change with the theme
173-
user_colors = [
174-
"var(--jp-collaborator-color1)",
175-
"var(--jp-collaborator-color2)",
176-
"var(--jp-collaborator-color3)",
177-
"var(--jp-collaborator-color4)",
178-
"var(--jp-collaborator-color5)",
179-
"var(--jp-collaborator-color6)",
180-
"var(--jp-collaborator-color7)",
181-
]
182-
183-
184-
def get_random_color() -> str:
185-
"""Get a random color from the list of colors."""
186-
return user_colors[random.randint(0, len(user_colors) - 1)]

0 commit comments

Comments
 (0)