# Double entry in default watch list @ user preferences -\> registration impossible

**URL:** https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181
**Category:** Bug
**Created:** [28.Декабрь.2015 00:08:56 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181 "2015-12-28T00:08:56Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [28.Декабрь.2015 00:08:56 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/1 "2015-12-28T00:08:56Z")

</div>

I run into the following issue:

By accident, I entered two times the same category into the default user preference field for the default watched categories.

Result: Accounts could not be created anymore

```plaintext
PG::UniqueViolation (ERROR: duplicate key value violates unique constraint "idx_category_users_u1" DETAIL: Key (user_id, category_id, notification_level)=(16, 11, 3) already exists. )

```

Solution: I removed the enry from the watch list so that the list was unique.

However, I would expect that Discourse doesn’t allow to add two times the same category to the watch list.

Best,  
Robert

---

<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: [28.Декабрь.2015 00:11:00 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/2 "2015-12-28T00:11:00Z")

</div>

What version are you on? We fixed this about a week or two ago via a unique table index.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [28.Декабрь.2015 00:17:47 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/3 "2015-12-28T00:17:47Z")

</div>

Yeah we should definitely guard against this buggy site setting a bit better.

The bug is that if you add “default watch” == “bug bug” we allow you to save it.

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [28.Декабрь.2015 00:18:37 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/4 "2015-12-28T00:18:37Z")

</div>

I’m on version `v1.5.0.beta7 +48`

---

<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: [28.Декабрь.2015 00:18:52 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/5 "2015-12-28T00:18:52Z")

</div>

Ok @techapj can you add this to your list? A client-side check for duplicates.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [28.Декабрь.2015 07:48:08 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/6 "2015-12-28T07:48:08Z")

</div>

I am not able to repro this issue. 😕

Once I select a category from category list, I am not able to select the same category again (as expected).

 ![](https://global.discourse-cdn.com/meta/original/3X/9/d/9dd4e6805457e4eb243a8f3cf94e0460fe532ae1.png)

---

<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: [28.Декабрь.2015 08:41:27 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/7 "2015-12-28T08:41:27Z")

</div>

Can you repro this here @rriemann? or on [try.discourse.org](http://try.discourse.org)?

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [28.Декабрь.2015 08:53:46 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/8 "2015-12-28T08:53:46Z")

</div>

I had category names like “A Announcements” and “B Announcements”. With the  
Discourse version I stated above, I cannot reproduce this either. It must have  
been a left over from a previous version, I guess. Now, the error message can  
be googled with a solution, it should be fine. 🙂

---

<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: [28.Декабрь.2015 09:36:35 UTC](https://meta.discourse.org/t/double-entry-in-default-watch-list-user-preferences-registration-impossible/37181/9 "2015-12-28T09:36:35Z")

</div>


