django-cms / djangocms-versioning

General purpose versioning package for Django CMS 4 and above.
Other
33 stars 29 forks source link

Allow draft to be accessible from monkeypatched queryset #190

Closed jonathan-s closed 4 years ago

jonathan-s commented 5 years ago

Only allowing published content to be available to be queried in the monkeypatched manager breaks any time get is used for draft content.

It is more intuitive if all content is queryable as normal in the monkeypatched modelmanager, this won't also break any code that tries to access versionend content that is other than published.

Instead, it would be better to have published queryset on the manager. (not in this PR yet).

An alternative way of solving this would then be to allow all states to be accessible when making a get query. This would allow the use case of when looking up an entry through pk which would otherwise return DoesNotExist.

How to test manually

Edit a page, add a new panel. Notice how when adding that new panel it won't reload the page as it did before.

jonathan-s commented 5 years ago

@czpython Since you reviewed #55 it would good to hear your thoughts on this too.

Aiky30 commented 4 years ago

Versioning was always designed to never return a draft or archived version to ensure that nothing could be seen by a visitor by accident. It's a fail safe that should never be undone.