Review Queue

Some companies have stricter policies for who can edit and who can publish content on their websites. The review queue app is an extension to versioning which collects commits for approval by a user with permissions.

The review_queue.change_reviewedversioncommit permission is used to determine who is allowed to approve commits.

To enabled the review queue,

  1. Add widgy.contrib.review_queue to your INSTALLED_APPS.

  2. Your WidgySite needs to inherit from ReviewedWidgySite.

  3. Register a subclass of VersionCommitAdminBase.

    from django.contrib import admin
    from widgy.contrib.review_queue.admin import VersionCommitAdminBase
    from widgy.contrib.review_queue.models import ReviewedVersionCommit
    
    class VersionCommitAdmin(VersionCommitAdminBase):
        def get_site(self):
            return my_site
    
    admin.site.register(ReviewedVersionCommit, VersionCommitAdmin)
    
  4. If upgrading from a non-reviewed site, a widgy.contrib.review_queue.models.ReviewedVersionCommit object must be created for each widgy.models.VersionCommit. There is a management command to do this for you. It assumes that all existing commits should be approved.

    ./manage.py populate_review_queue
    
class admin.VersionCommitAdminBase

This an abstract ModelAdmin class that displays the pending changes for approval. Any it abstract, because it doesn’t know which WidgySite to use.

get_site(self)

The WidgySite that this specific VersionCommitAdminBase needs to work on.

Note

The review queue’s undo (it can undo approvals) support requires Django >= 1.5 or the session-based MESSAGE_STORAGE:

MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'