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

feat: Add configuration to manage redirect on publish #358

Merged
merged 22 commits into from
Dec 28, 2023

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Oct 30, 2023

Description

Currently, upon publishing a page (or other content object) the user is redirected to the version admin of that object. This is excellent for power users.

This PR adds the setting DJANGOCMS_VERSIONING_ON_PUBLISH_REDIRECT with three possible values:

  • "published": Redirects to the objects .get_absolute_url() (if available, preview endpoint otherwise). This is close to v3's behaviour and potentially a good setting for an occasional editor.
  • "preview": Redirects to the object's preview endpoint, just as most other user interactions.
  • "versions": Redirects to the object's version list (as before)

The default is "published".

This is a draft PR. Tests will work, once #357 is merged.

Related resources

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

@marksweb marksweb self-assigned this Nov 13, 2023
@fsbraun fsbraun marked this pull request as ready for review November 16, 2023 16:32
Copy link

codecov bot commented Nov 19, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (0d5b461) 90.95% compared to head (de69f81) 90.84%.

Files Patch % Lines
djangocms_versioning/admin.py 68.75% 3 Missing and 2 partials ⚠️
djangocms_versioning/helpers.py 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #358      +/-   ##
==========================================
- Coverage   90.95%   90.84%   -0.12%     
==========================================
  Files          72       72              
  Lines        2533     2546      +13     
  Branches      356      361       +5     
==========================================
+ Hits         2304     2313       +9     
- Misses        168      169       +1     
- Partials       61       64       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fsbraun
Copy link
Member Author

fsbraun commented Nov 19, 2023

@marksweb I've fixed the tests for this. For py3.12 they keep failing due to the django-app-helper dependency.

tests/test_admin.py Outdated Show resolved Hide resolved
@fsbraun fsbraun merged commit b099c9a into django-cms:master Dec 28, 2023
43 of 45 checks passed
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