Skip to content

v1.41.0

Choose a tag to compare

@leafo leafo released this 10 Jan 01:17
· 193 commits to master since this release

Migrate:

require("community.schema").run_migrations(41)

Due to the changes in how topics_count and posts_count is calculated it is recommend to recount all the community users: (Note this query may be expensive depending on your database, review the query in the code and plan accordingly)

require("community.models").CommunityUsers:recount()

Additions

  • PendingPosts model is now ready for use
    • topic:post_needs_approval(user, post_data) method is called before creating a post in a topic to see if it should be created as a pending post instead
    • category:topic_needs_approval(user, post_data) method is called before creating topic in category to see if it should be created as pending post instead
    • instances of PendingPosts can be promoted to real posts by the promote method, which will delete the PendingPost after successfully promoting it
  • Module community.version now returns the correct version
  • Add purge_reports method to CommunityUsers to clean up any reports made by that user

Changes

  • posts_count on CommunityUsers will now plainly count all posts created by that user that aren't soft-deleted or moderation events. Previously posts that were considered a topic post would not be counted.
  • topics_count on CommunityUsers will no longer increment for permanent topics. (It's assumed permanent topics are not explicitly created by the user but implicitly exist for other objects eg. comments thread)
  • purge_posts and purge_votes methods on CommunityUsers deletes objects in batches and returned the total number of items removed
  • Fix error thrown where slug could not be generated for category tag name (such as emoji name)