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

Support custom max age + multiple links per Revision #7

Merged
merged 10 commits into from
Dec 4, 2024

Conversation

stevejalim
Copy link
Collaborator

@stevejalim stevejalim commented Dec 3, 2024

This changeset addresses some practical-usability issues with the project.

  1. It allows more than one sharing link to exist per Revision. This is to provide a way to avoid requesting a sharing link only to be given one that may shortly expire or - worse - one which technically has expired but will only be marked as such when it is next accessed. Neither situation is ideal, so we provide a way to make an all-new link (at the Python level - for now the UI still tries to reuse an existing link if one exists).

  2. It gives us more control over link expiry beyond the 'one size fits all' approach of having it as a project-wide setting. Now, it's possible to pass in a number of seconds as max_age when calling WagtaildraftsharingLink.objects.get_or_create_for_revision to set the expiry time of the link (or -1 to have no expiry at all)

  3. It refactors the settings to be a dictionary (based on how they're done in mozilla/wagtail-localize-smartling), making them easier to manage in a busy project. THIS IS A BREAKING CHANGE

Resolves #5
Resolves #6

Copy link
Collaborator Author

@stevejalim stevejalim left a comment

Choose a reason for hiding this comment

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

Self review: r+

@stevejalim stevejalim force-pushed the 5-customisable-max-age branch from 3587d92 to c17d3cd Compare December 4, 2024 11:37
@stevejalim stevejalim changed the title Support customising the max age for a link when generating one via Python Support custom max age + multiple links per Revision Dec 4, 2024
Copy link
Collaborator Author

@stevejalim stevejalim left a comment

Choose a reason for hiding this comment

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

Self review again: r+

@stevejalim stevejalim merged commit 768b989 into main Dec 4, 2024
4 checks passed
@stevejalim stevejalim deleted the 5-customisable-max-age branch December 4, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant