Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Fix username display showing None when full name not set (#138)

Murtaza Nasir2f7c194612cd
diff --git a/templates/components/header.html b/templates/components/header.html
index 21cddefb..3b0d2e64 100644
--- a/templates/components/header.html
+++ b/templates/components/header.html
@@ -49,7 +49,7 @@
class="flex items-center gap-1 sm:gap-2 p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors duration-200"
:title="t('admin.userMenu')">
<i class="fas fa-user-circle text-lg"></i>
- <span class="hidden lg:inline text-sm">{{ current_user.name if current_user.is_authenticated else 'User' }}</span>
+ <span class="hidden lg:inline text-sm">{{ (current_user.name or current_user.username) if current_user.is_authenticated else 'User' }}</span>
<i class="fas fa-chevron-down text-xs hidden sm:inline"></i>
</button>
diff --git a/templates/index.html b/templates/index.html
index 24eaa67e..8b3ded8c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -48,7 +48,7 @@
data-use-asr-endpoint="{{ use_asr_endpoint }}"
data-enable-archive-toggle="{{ enable_archive_toggle }}"
data-enable-internal-sharing="{{ enable_internal_sharing }}"
- data-current-user-name="{{ current_user.name if current_user.is_authenticated else '' }}"
+ data-current-user-name="{{ (current_user.name or current_user.username) if current_user.is_authenticated else '' }}"
data-user-language="{{ user_language }}"
class="h-full flex flex-col opacity-0 transition-opacity duration-500">
diff --git a/templates/inquire.html b/templates/inquire.html
index 1d75bd56..cdfbe1db 100644
--- a/templates/inquire.html
+++ b/templates/inquire.html
@@ -128,7 +128,7 @@
</head>
<body class="h-full bg-[var(--bg-primary)] text-[var(--text-primary)] transition-colors duration-300">
<div id="inquire-app" v-cloak class="h-full flex flex-col"
- data-current-user-name="{{ current_user.name if current_user.is_authenticated else '' }}">
+ data-current-user-name="{{ (current_user.name or current_user.username) if current_user.is_authenticated else '' }}">
<!-- Header -->
<header class="bg-[var(--bg-secondary)] border-b border-[var(--border-primary)] px-3 sm:px-4 py-3 flex items-center justify-between flex-shrink-0 z-50">
@@ -165,7 +165,7 @@
class="flex items-center gap-1 sm:gap-2 p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors duration-200"
:title="t('admin.userMenu')">
<i class="fas fa-user-circle text-lg"></i>
- <span class="hidden lg:inline text-sm">{{ current_user.name if current_user.is_authenticated else 'User' }}</span>
+ <span class="hidden lg:inline text-sm">{{ (current_user.name or current_user.username) if current_user.is_authenticated else 'User' }}</span>
<i class="fas fa-chevron-down text-xs hidden sm:inline"></i>
</button>