无法删除旧主题

我正在使用 Helm 将 bitnami discourse 镜像部署到服务器上,并且主要使用 API 与之进行交互。我遇到了以下问题:

用户可以创建一个主题,然后在创建后不久将其删除。但是,如果过了一周左右的时间,该用户在尝试删除帖子时会收到错误。查看日志,我看到:

Started DELETE “/t/124” for 162.220.157.139 at 2022-06-20 19:41:43 +0000
Mon, Jun 20 2022 2:41:43 pm Processing by TopicsController#destroy as JSON
Mon, Jun 20 2022 2:41:43 pm Parameters: {“id”=>“124”, “topic”=>{}}
Mon, Jun 20 2022 2:41:43 pm Can’t verify CSRF token authenticity.
Mon, Jun 20 2022 2:41:43 pm Completed 422 Unprocessable Entity in 29ms (Views: 0.2ms ActiveRecord: 0.0ms Allocations: 2357)

这是成功删除的日志:

Started DELETE “/t/135” for 162.220.157.139 at 2022-06-20 21:37:07 +0000
Mon, Jun 20 2022 4:37:08 pm Processing by TopicsController#destroy as JSON
Mon, Jun 20 2022 4:37:08 pm Parameters: {“id”=>“135”, “topic”=>{}}
Mon, Jun 20 2022 4:37:08 pm Can’t verify CSRF token authenticity.
Mon, Jun 20 2022 4:37:08 pm Rendered text template (Duration: 0.0ms Allocations: 1)
Mon, Jun 20 2022 4:37:08 pm Completed 200 OK in 301ms (Views: 1.4ms ActiveRecord: 0.0ms Allocations: 11569)

即使在实际的 UI 上,尝试删除较旧的消息也会出现:

You don’t have permission to delete this topic. If you really want it to be deleted, submit a flag for moderator attention together with reasoning.

有什么想法为什么用户在一段时间后无法删除自己的主题?

另外,正在使用 oidc 身份验证进行登录。(Keycloak)

有一个设置。在站点设置中搜索删除,您应该能找到它。

只要主题没有回复,用户就可以删除它,否则他们就会遇到那个错误。这是为了防止他们在未经工作人员知晓/批准的情况下删除他人的内容。

1 个赞

That’s it. I was thinking that there was a delete window like post edit time limit.

我已仔细检查了设置,并更改了所有可能适用于帖子、主题以及删除/移除的设置,但均未生效。

用户试图删除的帖子没有回复,但已发布一周以上。用户刚刚能够删除一个发布了 16 小时的帖子,稍后将测试一个发布了 24 小时的帖子。

这是用户以及他们无法删除的一个主题:

{
  user: {
    id: 20,
    username: 'molenchuk-tite-99ecd',
    name: 'teacher firstgrade',
    avatar_template: '/letter_avatar_proxy/v4/letter/m/cab0a1/{size}.png',
    email: 'molenchuk+titeacher@weare5stones.com',
    secondary_emails: [],
    active: true,
    admin: false,
    moderator: false,
    last_seen_at: '2022-06-20T21:49:19.750Z',
    last_emailed_at: null,
    created_at: '2022-06-13T16:33:29.655Z',
    last_seen_age: 60354.179525574,
    last_emailed_age: null,
    created_at_age: 684104.274168186,
    trust_level: 1,
    manual_locked_trust_level: null,
    flag_level: 0,
    title: null,
    time_read: 168,
    staged: false,
    days_visited: 1,
    posts_read_count: 6,
    topics_entered: 1,
    post_count: 0
  },
  topic: {
    post_stream: {
      posts: [
        {
          id: 127,
          name: 'teacher firstgrade',
          username: 'molenchuk-tite-99ecd',
          avatar_template: '/letter_avatar_proxy/v4/letter/m/cab0a1/{size}.png',
          created_at: '2022-06-13T16:36:45.485Z',
          cooked: '<p>This message is to confirm the system is working now.</p>',
          post_number: 1,
          post_type: 1,
          updated_at: '2022-06-13T16:36:45.485Z',
          reply_count: 0,
          reply_to_post_number: null,
          quote_count: 0,
          incoming_link_count: 0,
          reads: 2,
          readers_count: 1,
          score: 0.2,
          yours: false,
          topic_id: 124,
          topic_slug: 'confirmation-data',
          display_username: 'teacher firstgrade',
          primary_group_name: null,
          primary_group_flair_url: null,
          primary_group_flair_bg_color: null,
          primary_group_flair_color: null,
          version: 1,
          can_edit: true,
          can_delete: false,
          can_recover: false,
          can_wiki: true,
          read: false,
          user_title: null,
          bookmarked: false,
          actions_summary: [
            { id: 2, can_act: true },
            { id: 3, can_act: true },
            { id: 4, can_act: true },
            { id: 8, can_act: true },
            { id: 6, can_act: true },
            { id: 7, can_act: true }
          ],
          moderator: false,
          admin: false,
          staff: false,
          user_id: 20,
          hidden: false,
          trust_level: 1,
          deleted_at: null,
          user_deleted: false,
          edit_reason: null,
          can_view_edit_history: true,
          wiki: false,
          reviewable_id: 0,
          reviewable_score_count: 0,
          reviewable_score_pending_count: 0
        }
      ],
      stream: [ 127 ]
    },
    timeline_lookup: [ [ 1, 7 ] ],
    suggested_topics: [ [Object], [Object], [Object], [Object], [Object] ],
    id: 124,
    title: 'Confirmation Data',
    fancy_title: 'Confirmation Data',
    posts_count: 1,
    created_at: '2022-06-13T16:36:45.265Z',
    views: 9,
    reply_count: 0,
    like_count: 0,
    last_posted_at: '2022-06-13T16:36:45.485Z',
    visible: true,
    closed: false,
    archived: false,
    has_summary: false,
    archetype: 'regular',
    slug: 'confirmation-data',
    category_id: 22,
    word_count: 12,
    deleted_at: null,
    user_id: 20,
    featured_link: null,
    pinned_globally: false,
    pinned_at: null,
    pinned_until: null,
    image_url: null,
    slow_mode_seconds: 0,
    draft: null,
    draft_key: 'topic_124',
    draft_sequence: 0,
    unpinned: null,
    pinned: false,
    current_post_number: 1,
    highest_post_number: 1,
    deleted_by: null,
    has_deleted: false,
    actions_summary: [
      { id: 4, count: 0, hidden: false, can_act: true },
      { id: 8, count: 0, hidden: false, can_act: true },
      { id: 7, count: 0, hidden: false, can_act: true }
    ],
    chunk_size: 20,
    bookmarked: false,
    topic_timer: null,
    message_bus_last_id: 0,
    participant_count: 1,
    show_read_indicator: false,
    thumbnails: null,
    details: {
      can_edit: true,
      notification_level: 1,
      can_move_posts: true,
      can_delete: true,
      can_remove_allowed_users: true,
      can_invite_to: true,
      can_create_post: true,
      can_reply_as_new_topic: true,
      can_flag_topic: true,
      can_convert_topic: true,
      can_review_topic: true,
      can_close_topic: true,
      can_archive_topic: true,
      can_split_merge_topic: true,
      can_edit_staff_notes: true,
      can_toggle_topic_visibility: true,
      can_pin_unpin_topic: true,
      can_moderate_category: true,
      can_remove_self_id: 1,
      participants: [
        {
          id: 20,
          username: 'molenchuk-tite-99ecd',
          name: 'teacher firstgrade',
          avatar_template: '/letter_avatar_proxy/v4/letter/m/cab0a1/{size}.png',
          post_count: 1,
          primary_group_name: null,
          primary_group_flair_url: null,
          primary_group_flair_color: null,
          primary_group_flair_bg_color: null,
          trust_level: 1
        }
      ],
      created_by: {
        id: 20,
        username: 'molenchuk-tite-99ecd',
        name: 'teacher firstgrade',
        avatar_template: '/letter_avatar_proxy/v4/letter/m/cab0a1/{size}.png'
      },
      last_poster: {
        id: 20,
        username: 'molenchuk-tite-99ecd',
        name: 'teacher firstgrade',
        avatar_template: '/letter_avatar_proxy/v4/letter/m/cab0a1/{size}.png'
      }
    }
  }
}

你能从用户体验中删除它吗?

也无法从用户体验中删除它

那里的消息是什么?(然后你可以在代码中找到引用该错误的那个地方)

这是我收到的消息

这让我想起了编辑限制。

我认为,由于帖子中的文本已更改,因此在删除它时,此限制也会影响删除。

我记得这个主题,编辑也引起了麻烦。

1 个赞

一定是我在找的东西!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.