# Previewed Badges not Awarding

**URL:** <https://meta.discourse.org/t/previewed-badges-not-awarding/32896>\
**Category:** Product Support\
**Tags:** badges\
**Created:** [4 سبتمبر 2015، 12:45ص UTC](https://meta.discourse.org/t/previewed-badges-not-awarding/32896 "2015-09-04T00:45:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Umbrella](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/umbrella/32/116583_2.png) [@Umbrella](https://meta.discourse.org/u/Umbrella)\
**Post date:** [4 سبتمبر 2015، 7:23ص UTC](https://meta.discourse.org/t/previewed-badges-not-awarding/32896/3 "2015-09-04T07:23:06Z")

</div>

Thanks for the timely response! 🙂

> **Here's the error I have!**
>
> Job exception: PG::Error: ERROR: duplicate key value violates unique constraint "index\_user\_badges\_on\_badge\_id\_and\_user\_id\_and\_seq" DETAIL: Key (badge\_id, user\_id, seq)=(104, 224, 0) already exists. : INSERT INTO user\_badges(badge\_id, user\_id, granted\_at, granted\_by\_id, post\_id) SELECT 104, q.user\_id, q.granted\_at, -1, NULL FROM ( SELECT p.user\_id, p.id post\_id, p.updated\_at granted\_at FROM badge\_posts p WHERE p.post\_number \> 1 AND p.like\_count \>= 5 AND ('t' OR p.id IN (-2) ) ) q LEFT JOIN user\_badges ub ON ub.badge\_id = 104 AND ub.user\_id = q.user\_id
> 
> ```
> WHERE (ub.badge_id IS NULL AND q.user_id <> -1)
> RETURNING id, user_id, granted_at</details>
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/previewed-badges-not-awarding/32896)._
