-
Notifications
You must be signed in to change notification settings - Fork 80
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
Using StateManager for JobApplication model #432
Conversation
hasjob/models/jobpost.py
Outdated
def can_report(self): | ||
return self.response in (EMPLOYER_RESPONSE.NEW, EMPLOYER_RESPONSE.PENDING, | ||
EMPLOYER_RESPONSE.IGNORED, EMPLOYER_RESPONSE.REJECTED) | ||
@response.transition(response.FLAGGED, response.NEW, title=__("Unflag"), message=__("This job application has been unflagged"), type='success') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transition back to PENDING
hasjob/views/listing.py
Outdated
if job_application.response == EMPLOYER_RESPONSE.NEW: | ||
job_application.response = EMPLOYER_RESPONSE.PENDING | ||
if job_application.response.NEW: | ||
job_application.mark_read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be:
if job_application.mark_read.is_available:
job_application.mark_read()
hasjob/views/listing.py
Outdated
# If the application is pending, mark it as opened. | ||
# However, don't do this if the user is a siteadmin, unless they also own the post. | ||
if post.admin_is(g.user) or not lastuser.has_permission('siteadmin'): | ||
job_application.response = EMPLOYER_RESPONSE.PENDING | ||
job_application.mark_read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise
* initial changes for state manager for job application * added transitions for application processing * more fixes * transition fixes
No description provided.