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

Using StateManager for JobApplication model #432

Merged
merged 6 commits into from
Apr 11, 2018

Conversation

iambibhas
Copy link
Contributor

No description provided.

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')
Copy link
Member

Choose a reason for hiding this comment

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

Transition back to PENDING

if job_application.response == EMPLOYER_RESPONSE.NEW:
job_application.response = EMPLOYER_RESPONSE.PENDING
if job_application.response.NEW:
job_application.mark_read()
Copy link
Member

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()

# 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()
Copy link
Member

Choose a reason for hiding this comment

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

Likewise

@iambibhas iambibhas merged commit 8705491 into master Apr 11, 2018
@iambibhas iambibhas deleted the jobapplication-state-manager branch April 11, 2018 07:36
shreyas-satish pushed a commit that referenced this pull request Apr 11, 2018
* initial changes for state manager for job application

* added transitions for application processing

* more fixes

* transition fixes
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