Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unpublishing action #49

Closed
wants to merge 2 commits into from

Conversation

jonathan-s
Copy link
Contributor

@jonathan-s jonathan-s commented Oct 15, 2019

This adds an unpublishing action to the filer admin.

This PR depends on: django-cms/djangocms-moderation#166
Depends on #50 to run the tests.

How to test manually

Go to the folder view in filer. Click the three dots which will give you the dropdown action menu. In that menu there should be an option to select items to unpublish.

Try adding a draft file to unpublish. It will tell you that zero items were processed. Try adding a published file to unpublish it will take you to the next step to create a collection.

files_qs = files_qs.filter(versions__state=PUBLISHED)
return add_item_to_unpublish_collection(self, request, files_qs)


def get_actions(func):
def inner(self, request):
actions = func(self, request)

if is_moderation_enabled():
from djangocms_moderation.admin_actions import add_items_to_collection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise that we had moderation dependence in this package. Probably shouldn't have been the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you kind of have to have that dependence if you want to add it to a moderation collection.

@jonathan-s jonathan-s closed this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants