summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-05-23 17:39:52 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-05-24 12:21:15 +0200
commit4ba4275632351518a4b65e432914a60747ce3e52 (patch)
tree80f88831eb64c8b4c4439d8759afb53c30df3929 /lib
parentaa10b70f2a37c45bc2551f2a0d34a835dc7189f9 (diff)
downloadgitlab-shell-bvl-display-username-instead-of-fullname.tar.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_shell.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 0221624..9644cf4 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -196,8 +196,14 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
end
end
+ def username_from_discover
+ return nil unless user && user['username']
+
+ "@#{user['username']}"
+ end
+
def username
- @username ||= user && user['username'] || 'Anonymous'
+ @username ||= username_from_discover || 'Anonymous'
end
# User identifier to be used in log messages.