openownership / openownership.org-wagtail

Open Ownership Wagtail site.
Other
1 stars 1 forks source link

Expiring jobs pages once the application deadline has passed #348

Closed StephenAbbott closed 9 months ago

StephenAbbott commented 1 year ago

In our initial Wagtail v2 setup for the Open Ownership website, there was an expiration date field for Job pages. When set, this would remove the pages from the live site after the application date had passed.

In our current Wagtail v4 setup, we are keen to use this same functionality but are unsure how to do so. There is an Application deadline field on the Content tab for each job page:

image

And we can see in the CMS that job pages are given an Expired label once this Application deadline has passed:

image

However at the moment this expiration doesn't result in any changes on the job page. So the Open Ownership team is manually unpublishing job ads the day after the application deadline has passed.

The functionality we would like to see is for job pages to automatically be unpublished/moved to draft two days after the application deadline as most of our application deadlines are one minute to midnight at the very end of the application date given on the job pages. Is that possible in Wagtail 4?

philgyford commented 1 year ago

@StephenAbbott Just checking: From your team's point of view, would it be better / more flexible / clearer if there was a second date (or date + time) field for when the job should disappear from the site?

If you would only ever set this to 2 days after the deadline, maybe it would be annoying to fill in every time. On the other hand it would be more flexible – you could change the gap between deadline and expiration over time – and it's more explicit about the meaning and effect of each date.

StephenAbbott commented 1 year ago

@philgyford Yes. A second expiry date/time field would be preferable as it may not always be two days after the deadline that we want the job ad to disappear (for example, if an ad closed before a long weekend or public holiday). Thanks

philgyford commented 1 year ago

@StephenAbbott I just recalled – this should already be possible in Wagtail.

When editing a page:

  1. Click the "I" at top-right to view the page's Status
  2. Click "Set Schedule"
  3. You can set an Expiry date/time

Expired pages will be set to a Status of Draft.

Assuming setting a "Go live date/time" already works, the expiry time should work too. I'm not sure if you already use the "Go live date/time"?

StephenAbbott commented 1 year ago

Aha. Did not know this functionality already existed. Will get my colleagues to test it. Thanks @philgyford

StephenAbbott commented 1 year ago

@philgyford So we've tested the Set Schedule and Expiry date/time functionality with a couple of pages this week on the staging site and nothing changed after the expiry date/time had passed https://openownership.hactar.work/admin/pages/589/edit/

philgyford commented 1 year ago

@drcongo Can you check that the publish_scheduled management command is running regularly on Staging? I think that's the thing that should make this happen?

StephenAbbott commented 9 months ago

Based on testing carried out by Open Ownership communications team in November 2023, this page expiry functionality is working as expected so I'll close the ticket