# Cancelling "Edit Category" screen changes "Following" status

**URL:** https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861
**Category:** Bug
**Created:** [07.Август.2015 07:57:53 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861 "2015-08-07T07:57:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [07.Август.2015 07:57:53 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/1 "2015-08-07T07:57:53Z")

</div>

Edit a category and then cancel immediately.  
If you followed category before editing, it will now show you aren’t following anymore.

 ![](https://global.discourse-cdn.com/meta/original/3X/9/0/908b37d083c54abd1e6f3a2ce1b601b6871b0fdc.gif)

---

<div class="post-metadata">

### Author: ![AbbasFaisal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abbasfaisal/32/158588_2.png) [@AbbasFaisal](https://meta.discourse.org/u/AbbasFaisal)
#### Post date: [30.Ноябрь.2015 20:42:40 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/2 "2015-11-30T20:42:40Z")

</div>

`notification_level` is unset when the `category` object is serialized and transferred to the browser. Setting it in `categories_controller.rb` fixes the issue. Like so.

```plaintext
def show
    if Category.topic_create_allowed(guardian).where(id: @category.id).exists?
      @category.permission = CategoryGroup.permission_types[:full]
    end

-> @category.notification_level = CategoryUser.where(category: @category.id).first.notification_level**

    render_serialized(@category, CategorySerializer)`
end

```

@sam?

---

<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: [30.Ноябрь.2015 20:47:03 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/3 "2015-11-30T20:47:03Z")

</div>

Perhaps submit a PR to fix?

---

<div class="post-metadata">

### Author: ![AbbasFaisal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abbasfaisal/32/158588_2.png) [@AbbasFaisal](https://meta.discourse.org/u/AbbasFaisal)
#### Post date: [30.Ноябрь.2015 20:53:21 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/4 "2015-11-30T20:53:21Z")

</div>

Sure. just got a bit nervous being a first timer.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [06.Декабрь.2015 02:01:13 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/5 "2015-12-06T02:01:13Z")

</div>

I’m reporting issues with pleasure, but unfortunately not able to fix them as I do not run dev instance of Discourse locally.

---

<div class="post-metadata">

### Author: ![AbbasFaisal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abbasfaisal/32/158588_2.png) [@AbbasFaisal](https://meta.discourse.org/u/AbbasFaisal)
#### Post date: [14.Декабрь.2015 07:10:29 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/6 "2015-12-14T07:10:29Z")

</div>

Fixed with:  
[https://github.com/discourse/discourse/pull/3911](https://github.com/discourse/discourse/pull/3911)  
thanks @tgxworld.

---

<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: [16.Декабрь.2015 01:56:29 UTC](https://meta.discourse.org/t/cancelling-edit-category-screen-changes-following-status/31861/7 "2015-12-16T01:56:29Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
