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

Fix job listings with multiple USAJobs links #5458

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

willbarton
Copy link
Member

This is a fix for job listings that have multiple USAJobs links in them. With Python 3's stricter comparisons, attempting to order the USAJobsApplicationLink objects using applicant_type was failing with ApplicantType not supporting < operations.

This fix adds __gt__ and __lt__ to ApplicantType to support > and < operations.

Generally this appears to come from django-modelcluster and behavior that differs from the Django expectation, possibly related to wagtail/django-modelcluster#45.

Testing

  1. Create or edit a job listing to have multiple USAJobs application links
  2. Try to preview the page and notice a 500
  3. Checkout this branch
  4. Preview the job listing again and notice it works as expected

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • Reviewers requested with the Reviewers tool ➡️

This is a fix for job listings that have multiple USAJobs links in them. With Python 3's stricter comparisons, attempting to order the `USAJobsApplicationLink` objects using `applicant_type` was failing with `ApplicantType` not supporting `<` operations.

This fix adds `__gt__` and `__lt__` to `ApplicantType` to support `>` and `<` operations.

Generally this appears to come from django-modelcluster and behavior that differs from the Django expectation, possibly related to wagtail/django-modelcluster#45.
Copy link
Contributor

@Scotchester Scotchester left a comment

Choose a reason for hiding this comment

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

Works as advertised!

@willbarton willbarton merged commit aa11a3b into master Jan 15, 2020
@willbarton willbarton deleted the fix-jobmanager-applicant-type branch January 15, 2020 15:05
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.

None yet

2 participants