# ИСПРАВЛЕНИЕ: Восстановить статус кнопки редактирования поста, если удаление не удалось

**URL:** https://meta.discourse.org/t/fix-restore-post-edit-button-status-when-the-deletion-is-not-successful/393038
**Category:** Bug
**Created:** [09.Январь.2026 07:20:22 UTC](https://meta.discourse.org/t/fix-restore-post-edit-button-status-when-the-deletion-is-not-successful/393038 "2026-01-09T07:20:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![small-lovely-cat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/small-lovely-cat/32/553546_2.png) [@small-lovely-cat](https://meta.discourse.org/u/small-lovely-cat)
#### Post date: [09.Январь.2026 07:20:22 UTC](https://meta.discourse.org/t/fix-restore-post-edit-button-status-when-the-deletion-is-not-successful/393038/1 "2026-01-09T07:20:22Z")

</div>

Когда пользователь пытается удалить пост, страница предварительно загружает представление удалённого поста и ожидает результата удаления.

Однако исходная настройка не восстанавливала свойство `can_edit`, поэтому при неудачном удалении (например, при достижении дневного лимита) кнопка редактирования исчезает при восстановлении без перезагрузки темы.

> <https://github.com/discourse/discourse/pull/37026>
>
> When user tries to delete a post, the page will preload the deleted view and wai…t for the deletion result.
> 
> However, the original setting failed to restore the \`can\_edit\` property, so when the deletion is unsuccessful (e.g, reached daily limit) and the status is rolled back, the edit button will disappear.
> 
> This commit saves the original \`can\_edit\` status, and assigns it back when rolling back.
> 
> Before:
> 
> https://github.com/user-attachments/assets/c9ed0791-27ae-4d69-842d-b9a1a24314b4
> 
> After:
> 
> https://github.com/user-attachments/assets/ad0825c4-60ad-4b23-bf95-b41ceed22e49

---

<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: [13.Январь.2026 05:26:29 UTC](https://meta.discourse.org/t/fix-restore-post-edit-button-status-when-the-deletion-is-not-successful/393038/2 "2026-01-13T05:26:29Z")

</div>

Спасибо большое, какой необычный частный случай!

---

<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: [13.Январь.2026 21:00:54 UTC](https://meta.discourse.org/t/fix-restore-post-edit-button-status-when-the-deletion-is-not-successful/393038/3 "2026-01-13T21:00:54Z")

</div>

Эта тема была автоматически закрыта через 15 часов. Новые ответы больше не принимаются.
