# Groups can be given same name as existing username

**URL:** <https://meta.discourse.org/t/groups-can-be-given-same-name-as-existing-username/74010>\
**Category:** Bug\
**Created:** [13.Ноябрь.2017 21:00:23 UTC](https://meta.discourse.org/t/groups-can-be-given-same-name-as-existing-username/74010 "2017-11-13T21:00:23Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [02.Апрель.2018 10:27:53 UTC](https://meta.discourse.org/t/groups-can-be-given-same-name-as-existing-username/74010/10 "2018-04-02T10:27:53Z")

</div>

I’ve added the missing server side validations for now in

[https://github.com/discourse/discourse/commit/221503cd10d1421f1a0e02931c034d6cd468e57c](https://github.com/discourse/discourse/commit/221503cd10d1421f1a0e02931c034d6cd468e57c)

@sam I’m unsure about how we should proceed here with regards to the database constraints though, do you think it is worth extracting `User#username` and `Group#name` into a separate table? Those two columns are used frequently so having to join on another table might be expensive. Instead of splitting into another table, I was thinking of treating `Group#name` as having a lower priority than `User#username`. We’ll just run a periodic job that ensures that no group names would clash with a user. If someone manages to sneak a group named  
`test` past our server side validations when a user `test` already exists, the job would just rename the group to `test1`.

---

_[View the full topic](https://meta.discourse.org/t/groups-can-be-given-same-name-as-existing-username/74010)._
