• GitHub
  • Documentation
  • Discord
  • Donate
search
  • chevron_right Threads
  • label Support

Changing forumindex to categories causes KeyError at / 'can_see_all_threads'

HannahWinis
March 19, 2024
chat_bubble_outline 5
  • check_circle
  • link
    HannahWinis
    Members 3 posts
    March 19, 2024, 1:29 p.m. March 19, 2024, 1:29 p.m.
    link

    Fresh install of docker misago, it was working fine with threads on homepage, but after changing forumindex to categories frontpage returns an error:
    Looks like acl issue with AnonymousUser or could it be something related to categories permissions? Or is it a bug? Or misconfiguration?

    error-misago.png

    PNG, 263.1 KB, uploaded by HannahWinis on March 19, 2024.

  • link
    rafalp
    Project Lead 1981 posts
    March 19, 2024, 11:04 p.m. March 19, 2024, 11:04 p.m.
    link

    Is this a default category? Is the error only for guest users or signed in members are experiencing it too?

    Did you change category permissions?

    frollow likes this.

    favorite 1

  • link
    HannahWinis
    Members 3 posts
    March 20, 2024, 8:51 a.m. March 20, 2024, 8:51 a.m.
    link

    This is only for guests/not-logged-in. Logged in admin user is fine.

    I added new categories.

    Category permissions were updated to can see / can read (half / half, not sure whats the difference).

    Any clues how to debug?

  • link
    rafalp
    Project Lead 1981 posts
    March 20, 2024, 11:15 a.m. March 20, 2024, 11:15 a.m.
    link
    check_box

    Marked as best answer by March 20, 2024, 1:15 p.m..

    I am suspecting that because category roles saved to database are not defining can_see_all_threads for see only role, this triggers missing key error.

    The fix should be as simple as editing each category role in Misago admin and clicking "save". This will update category role with entries for all permissions.

    I can also do a bugfix release over the weekend that will make view don't explode if category has no see all threads entry in perms map.

  • link
    HannahWinis
    Members 3 posts
    March 20, 2024, 1:16 p.m. March 20, 2024, 1:16 p.m.
    link

    Quick fix worked! nice one! Thanks!

    Yes, I think this is a candidate for some

    if key in dict
    

    To avoid such errors in the future.

  • link
    rafalp
    Project Lead 1981 posts
    March 20, 2024, 5:46 p.m. March 20, 2024, 5:46 p.m.
    link

    More like .get("perm") or False, but I would say the issue is its possible for permission entry to be missing in first place. I will propably fix this in a small bugfix release sometime soon. "Proper" change is moot because next feature release replaces old permissions system with new one. But that's few months away still.

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Donate
  • Terms of service
  • Privacy policy
powered by misago