# Bug when discobot assigns the name in the certificate

**URL:** https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220
**Category:** Bug
**Tags:** discobot
**Created:** [Junho 9, 2017, 10:38am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220 "2017-06-09T10:38:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 9, 2017, 10:38am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/1 "2017-06-09T10:38:18Z")

</div>

For obvious reasons I can not repro the bug here on Meta.

I asked my team to test discobot after seeing that in the certificate I was assigned with the name of a group that was deleted months ago (SupportTeam)

 ![](https://global.discourse-cdn.com/meta/original/4X/c/d/7/cd76f127998cc1a3adeabbc126b6771e470d1033.png)  
Another member (he was a member of Support Team too) has been assigned the old username (Xtkale) that he changed years ago in Alex

 ![](https://global.discourse-cdn.com/meta/original/3X/a/2/a275b80767994aa04650a7fdd76a5e6e2a9abb8e.jpg)

And here another one, his username is murra, murray was the old username (he has never been a member of the Support Team)

 ![](https://global.discourse-cdn.com/meta/original/4X/8/8/5/885d28c9cc07363e0fb4b1afdbc7bad88d69f0bc.png)

It seems that discobot assigns the old username if you changed it. And if you never changed it he assigns the name of a deleted group if you belonged to that group.

EDIT: another recent member of our team has completed the tutorial for new user. He changed username **before** entering the team and discobot has given him to correct username.  
The other members mentioned above have changed username **after** entering in some group, so probably discobot has problems with obsolete informations relative to groups.

EDIT2 : find some errors in the log

info:

```
Discourse::InvalidParameters (user_id must be present)
/var/www/discourse/plugins/discourse-narrative-bot/plugin.rb:80:in `generate'

```

> **backtrace**
>
> ```
> /var/www/discourse/plugins/discourse-narrative-bot/plugin.rb:80:in `generate'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:198:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:117:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:505:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in ` __run_callbacks__'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/callbacks.rb:19:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/abstract_controller/base.rb:137:in `process'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-4.2.8/lib/action_view/rendering.rb:30:in `process'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-0.10.4/lib/mini_profiler/profiling_methods.rb:76:in `block in profile_method'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal.rb:196:in `dispatch'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_controller/metal.rb:237:in `block in action'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:43:in `serve'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:43:in `block in serve'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `each'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `serve'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:817:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/engine.rb:518:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/mapper.rb:51:in `serve'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:43:in `block in serve'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `each'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/journey/router.rb:30:in `serve'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/routing/route_set.rb:817:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:189:in `call!'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/strategy.rb:167:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/omniauth-1.6.1/lib/omniauth/builder.rb:63:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/conditionalget.rb:25:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
> /var/www/discourse/lib/middleware/anonymous_cache.rb:138:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/flash.rb:260:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:225:in `context'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:220:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/cookies.rb:560:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/query_cache.rb:36:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:88:in ` __run_callbacks__'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/logster-1.2.7/lib/logster/middleware/reporter.rb:31:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:38:in `call_app'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/rack/logger.rb:22:in `call'
> /var/www/discourse/config/initializers/100-quiet_logger.rb:17:in `call_with_quiet_assets'
> /var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/request_id.rb:21:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/methodoverride.rb:22:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/runtime.rb:18:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/sendfile.rb:113:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-0.10.4/lib/mini_profiler/profiler.rb:171:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.0.2/lib/message_bus/rack/middleware.rb:62:in `call'
> /var/www/discourse/lib/middleware/request_tracker.rb:73:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/engine.rb:518:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/application.rb:165:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/urlmap.rb:66:in `block in call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `each'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-1.6.8/lib/rack/urlmap.rb:50:in `call'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:606:in `process_client'
> /var/www/discourse/lib/scheduler/defer.rb:85:in `process_client'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:702:in `worker_loop'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:142:in `start'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/bin/unicorn:126:in `<top (required)>'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:22:in `load'
> /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:22:in `<main>'
> 
> ```

> **env**
>
> ```
> hostname	adu1-app
> process_id	178
> application_version	d326784ecfe66adb16eab9800550ad7c4864464e
> HTTP_HOST	forum.adunanza.net
> REQUEST_URI	/discobot/certificate.svg
> REQUEST_METHOD	HEAD
> HTTP_USER_AGENT	Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
> HTTP_ACCEPT	text/html
> HTTP_X_FORWARDED_FOR	51.15.41.81, unix:
> HTTP_X_REAL_IP	unix:
> 
> ```

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 10, 2017, 10:27am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/2 "2017-06-10T10:27:56Z")

</div>

Another member of my team send me a message with his certificates (new and advanced). In both of them discobot assigns to him an old custom title that I (or the other admin) give to him and that it was deleted when he choose to use a title from one of our custom badges (relative to his group).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Junho 11, 2017, 12:10am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/3 "2017-06-11T00:10:17Z")

</div>

Hmm why is title being used here @tgxworld? Or maybe I was misunderstanding what you wrote @Trash, why does title have anything to do with username?

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 11, 2017, 8:53am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/4 "2017-06-11T08:53:22Z")

</div>

I asked again to him, he said “I don’t remember if it was a old title or if it was what I wrote in the past in my biography (About me) on my profile.”

With certainty, I know that he has never changed username.

EDIT: I forgot to insert the link of the discussion in our public test category [Adubot test - #34 by Alex - Prove - AduForum](https://forum.adunanza.net/t/adubot-test/13618/34?u=dax) (from post #34 onwards)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [Junho 12, 2017, 12:52am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/5 "2017-06-12T00:52:00Z")

</div>

> [@Trash](#):
>
> It seems that discobot assigns the old username if you changed it. And if you never changed it he assigns the name of a deleted group if you belonged to that group.

Nope this isn’t the case. The bot looks for the user’s `Name` column and uses that if it exists. Otherwise, it uses the user’s username.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 9:09am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/6 "2017-06-12T09:09:36Z")

</div>

> [@tgxworld](#):
>
> Nope this isn’t the case. The bot looks for the user’s Name column and uses that if it exists. Otherwise, it uses the user’s username.

I understand, but in my site there’s no name to set for users (never enabled), only the username.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [Junho 12, 2017, 9:10am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/7 "2017-06-12T09:10:10Z")

</div>

Hmm that is very odd… I’m assuming you’re on the latest and everything?

If so, can you run the following commands in `rails c`?

```ruby
user = User.find_by(username: <your username>)
(user.name && !user.name.blank? ? user.name : user.username).titleize

```

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 10:09am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/8 "2017-06-12T10:09:52Z")

</div>

```plaintext
user = User.find_by(username: Dax)
(user.name && !user.name.blank? ? user.name : user.username).titleize
[1] pry(main)> user = User.find_by(username: Dax)
NameError: uninitialized constant Dax
from (pry):1:in ` __pry__'
[2] pry(main)> (user.name && !user.name.blank? ? user.name : user.username).titleize
NoMethodError: undefined method `name' for nil:NilClass
from (pry):2:in ` __pry__'
[3] pry(main)>
```

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [Junho 12, 2017, 10:31am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/9 "2017-06-12T10:31:53Z")

</div>

Oops you need quotes around ‘Dax’

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [Junho 12, 2017, 10:32am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/10 "2017-06-12T10:32:20Z")

</div>

username should be between `'`, so `user = User.find_by(username: 'Dax')` for the first line.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 11:12am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/11 "2017-06-12T11:12:08Z")

</div>

```plaintext
user = User.find_by(username: 'Dax')
[1] pry(main)> user = User.find_by(username: 'Dax')
=> #<User:0x0055643d3b5690
 id: 7,
 username: "Dax",
 created_at: Sat, 14 Dec 2013 23:02:47 UTC +00:00,
 updated_at: Sun, 11 Jun 2017 21:20:55 UTC +00:00,
 name: "SupportTeam",
 seen_notification_id: 276379,
 last_posted_at: Sun, 11 Jun 2017 21:20:55 UTC +00:00,
 email: "xxxxx@gmail.com",
 password_hash:
  "826b15de7d524221c26e2xxxxxxxxxxxxxxxxxxxxxxe1cf2",
 salt: "e57b795axxxxxxxxxxx99b74f4",
 active: true,
 username_lower: "dax",
 last_seen_at: Mon, 12 Jun 2017 11:01:58 UTC +00:00,
 admin: true,
 last_emailed_at: Mon, 12 Jun 2017 10:08:24 UTC +00:00,
 trust_level: 4,
 approved: false,
 approved_by_id: nil,
 approved_at: nil,
 previous_visit_at: Sun, 11 Jun 2017 21:20:54 UTC +00:00,
 suspended_at: nil,
[2] pry(main)>
[3] pry(main)> (user.name && !user.name.blank? ? user.name : user.username).titleize
=> "Support Team"
[4] pry(main)>

```

Changed password hash, email and salt.

Before running the command we have upgraded all again.

In our forum the “name” should be blank because we never set it. And SupportTeam is the name of our first old custom group (set as primary) before we rework all the groups. This group has been deleted for a long time

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Junho 12, 2017, 11:50am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/12 "2017-06-12T11:50:59Z")

</div>

By chance do you have full name disabled on your site (`enable names`)? I wonder if a check needs to be made against that site setting too. As I know when we imported, the import set a Full Name on many users, but since we’ve disabled Full Name, they have no way of clearing out the full name that was auto-set via the import.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 11:56am UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/13 "2017-06-12T11:56:50Z")

</div>

> [@cpradio](#):
>
> By chance do you have full name disabled on your site (enable names)?

Yes, it is disabled, but we did not migrate our old forum (it has been closed).  
 ![](https://global.discourse-cdn.com/meta/original/4X/5/8/6/586f60fe41a8078f4b7dbc5d7218cfdf9165caea.png)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Junho 12, 2017, 12:17pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/14 "2017-06-12T12:17:15Z")

</div>

> [@Trash](#):
>
> but we did not migrate our old forum (it has been closed).

Yeah, I didn’t mean to imply you did. You could have had full name enabled for a short period of time and people had it set, or countless other ways for it to get set. The point was, since you have it disabled, the bot should probably take that into account versus just looking to see if the name property has a value.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 1:45pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/15 "2017-06-12T13:45:58Z")

</div>

> [@cpradio](#):
>
> You could have had full name enabled for a short period of time and people had it set

Before the site was open to the public I’m pretty sure that our founder disable that setting. Being very attentive to the user privacy, he would never have set a similar setting

In any event, as far as I concerned, I’m sure that **I never set a name** and certantly, even if I did, it would not be “Support Team”.

But, the point is..there is a way to overwrite the name for all the users to “nil” how are the new registered users ?

```plaintext
 id: 8999,
 username: "Monik_Fatina",
 created_at: Sun, 11 Jun 2017 20:12:40 UTC +00:00,
 updated_at: Sun, 11 Jun 2017 20:12:40 UTC +00:00,
 name: nil,
```

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [Junho 12, 2017, 3:01pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/16 "2017-06-12T15:01:31Z")

</div>

Way back when, did you do more than CSS when you were working on group titles showing on the user cards?

> [@Primary group class not available on usercard and user page](https://meta.discourse.org/t/primary-group-class-not-available-on-usercard-and-user-page/32417):
>
> Hi, I want to create a customization for a group of users, DevTeam. It’s not a Primary group and users have different TL. How can I do that? It’s something like this: [image] I used Css to customize admins and mods group: .username.staff a { background: #C30303; padding: 3px 6px; line-height: 1; border-radius: 2px; display: inline-block; color: #FFF; } .username.staff { max-width: initial !important; } .username.moderator .fa.fa-shield { display: none; } …

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 3:39pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/17 "2017-06-12T15:39:00Z")

</div>

> [@Mittineague](#):
>
> did you do more than CSS when you were working on group titles showing on the user cards?

Relative to the site, yes. Relative to the usernames, probably the answer is yes (I need to check).  
Are you suggesting to try the tutorial in the safe-mode without custom css to verify?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [Junho 12, 2017, 3:56pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/18 "2017-06-12T15:56:44Z")

</div>

> [@Trash](#):
>
> name: “SupportTeam”,

That’s why. No bug on the bot.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [Junho 12, 2017, 4:01pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/19 "2017-06-12T16:01:26Z")

</div>

> [@Falco](#):
>
> That’s why. No bug on the bot.

I’m confused.  
It’s not a name , it’s a CSS content that I added:

```
.username.staff::after, .user-main .fa.fa-shield::before, #user-card .fa.fa-shield::before {
    content: 'SupportTeam';

```

Are you saying that discourse “read it” as a name and add it to the database?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Junho 12, 2017, 4:40pm UTC](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220/20 "2017-06-12T16:40:41Z")

</div>

> [@Falco](#):
>
> That’s why. No bug on the bot.

I’m not convinced of that, as he has `enable names` disabled, so shouldn’t the bot not even consider full name in that scenario? Regardless if it still has a value.

[Próxima página](https://meta.discourse.org/t/bug-when-discobot-assigns-the-name-in-the-certificate/64220.md?page=2)
