Workflow
hypha.apply.funds.workflow
¶
PHASE_BG_COLORS
module-attribute
¶
PHASE_BG_COLORS = {'Draft': 'bg-gray-200', 'Accepted': 'bg-green-200', 'Need screening': 'bg-cyan-200', 'Ready for Determination': 'bg-blue-200', 'Ready For Discussion': 'bg-blue-100', 'Invited for Proposal': 'bg-green-100', 'Internal Review': 'bg-yellow-200', 'External Review': 'bg-yellow-200', 'More information required': 'bg-yellow-100', 'Accepted but additional info required': 'bg-green-100', 'Dismissed': 'bg-rose-200'}
default_permissions
module-attribute
¶
default_permissions = make_permissions(edit=[staff_can], review=[staff_can])
hidden_from_applicant_permissions
module-attribute
¶
hidden_from_applicant_permissions = make_permissions(edit=[staff_can], review=[staff_can], view=[staff_can, reviewer_can])
reviewer_review_permissions
module-attribute
¶
reviewer_review_permissions = make_permissions(edit=[staff_can], review=[staff_can, reviewer_can])
community_review_permissions
module-attribute
¶
community_review_permissions = make_permissions(edit=[staff_can], review=[staff_can, reviewer_can, community_can])
applicant_edit_permissions
module-attribute
¶
applicant_edit_permissions = make_permissions(edit=[applicant_can, partner_can], review=[staff_can])
staff_edit_permissions
module-attribute
¶
staff_edit_permissions = make_permissions(edit=[staff_can])
SingleStageDefinition
module-attribute
¶
SingleStageDefinition = [{DRAFT_STATE: {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT}, 'method': 'create_revision'}}, 'display': gettext('Draft'), 'stage': Request, 'permissions': applicant_edit_permissions}}, {INITIAL_STATE: {'transitions': {'more_info': gettext('Request More Information'), 'internal_review': gettext('Open Review'), 'determination': gettext('Ready For Determination'), 'almost': gettext('Accept but additional info required'), 'accepted': gettext('Accept'), 'rejected': gettext('Dismiss')}, 'display': gettext('Need screening'), 'public': gettext('Application Received'), 'stage': Request, 'permissions': default_permissions}, 'more_info': {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}, 'determination': gettext('Ready For Determination'), 'almost': gettext('Accept but additional info required'), 'accepted': gettext('Accept'), 'rejected': gettext('Dismiss')}, 'display': gettext('More information required'), 'stage': Request, 'permissions': applicant_edit_permissions}}, {'internal_review': {'transitions': {'post_review_discussion': gettext('Close Review'), INITIAL_STATE: gettext('Need screening (revert)')}, 'display': gettext('Internal Review'), 'public': format(org_short_name=ORG_SHORT_NAME), 'stage': Request, 'permissions': default_permissions}}, {'post_review_discussion': {'transitions': {'post_review_more_info': gettext('Request More Information'), 'determination': gettext('Ready For Determination'), 'internal_review': gettext('Open Review (revert)'), 'almost': gettext('Accept but additional info required'), 'accepted': gettext('Accept'), 'rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': Request, 'permissions': hidden_from_applicant_permissions}, 'post_review_more_info': {'transitions': {'post_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}, 'determination': gettext('Ready For Determination'), 'almost': gettext('Accept but additional info required'), 'accepted': gettext('Accept'), 'rejected': gettext('Dismiss')}, 'display': gettext('More information required'), 'stage': Request, 'permissions': applicant_edit_permissions}}, {'determination': {'transitions': {'post_review_discussion': gettext('Ready For Discussion (revert)'), 'almost': gettext('Accept but additional info required'), 'accepted': gettext('Accept'), 'rejected': gettext('Dismiss')}, 'display': gettext('Ready for Determination'), 'permissions': hidden_from_applicant_permissions, 'stage': Request}}, {'accepted': {'display': gettext('Accepted'), 'future': gettext('Application Outcome'), 'stage': Request, 'permissions': staff_edit_permissions}, 'almost': {'transitions': {'accepted': gettext('Accept'), 'post_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('Accepted but additional info required'), 'stage': Request, 'permissions': applicant_edit_permissions}, 'rejected': {'display': gettext('Dismissed'), 'stage': Request, 'permissions': no_permissions}}]
SingleStageExternalDefinition
module-attribute
¶
SingleStageExternalDefinition = [{DRAFT_STATE: {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT}, 'method': 'create_revision'}}, 'display': gettext('Draft'), 'stage': RequestExt, 'permissions': applicant_edit_permissions}}, {INITIAL_STATE: {'transitions': {'ext_more_info': gettext('Request More Information'), 'ext_internal_review': gettext('Open Review'), 'ext_determination': gettext('Ready For Determination'), 'ext_rejected': gettext('Dismiss')}, 'display': gettext('Need screening'), 'public': gettext('Application Received'), 'stage': RequestExt, 'permissions': default_permissions}, 'ext_more_info': {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': RequestExt, 'permissions': applicant_edit_permissions}}, {'ext_internal_review': {'transitions': {'ext_post_review_discussion': gettext('Close Review'), INITIAL_STATE: gettext('Need screening (revert)')}, 'display': gettext('Internal Review'), 'public': format(org_short_name=ORG_SHORT_NAME), 'stage': RequestExt, 'permissions': default_permissions}}, {'ext_post_review_discussion': {'transitions': {'ext_post_review_more_info': gettext('Request More Information'), 'ext_external_review': gettext('Open External Review'), 'ext_determination': gettext('Ready For Determination'), 'ext_internal_review': gettext('Open Internal Review (revert)'), 'ext_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': RequestExt, 'permissions': hidden_from_applicant_permissions}, 'ext_post_review_more_info': {'transitions': {'ext_post_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': RequestExt, 'permissions': applicant_edit_permissions}}, {'ext_external_review': {'transitions': {'ext_post_external_review_discussion': gettext('Close Review'), 'ext_post_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('External Review'), 'stage': RequestExt, 'permissions': reviewer_review_permissions}}, {'ext_post_external_review_discussion': {'transitions': {'ext_post_external_review_more_info': gettext('Request More Information'), 'ext_determination': gettext('Ready For Determination'), 'ext_external_review': gettext('Open External Review (revert)'), 'ext_almost': gettext('Accept but additional info required'), 'ext_accepted': gettext('Accept'), 'ext_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': RequestExt, 'permissions': hidden_from_applicant_permissions}, 'ext_post_external_review_more_info': {'transitions': {'ext_post_external_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': RequestExt, 'permissions': applicant_edit_permissions}}, {'ext_determination': {'transitions': {'ext_post_external_review_discussion': gettext('Ready For Discussion (revert)'), 'ext_almost': gettext('Accept but additional info required'), 'ext_accepted': gettext('Accept'), 'ext_rejected': gettext('Dismiss')}, 'display': gettext('Ready for Determination'), 'permissions': hidden_from_applicant_permissions, 'stage': RequestExt}}, {'ext_accepted': {'display': gettext('Accepted'), 'future': gettext('Application Outcome'), 'stage': RequestExt, 'permissions': staff_edit_permissions}, 'ext_almost': {'transitions': {'ext_accepted': gettext('Accept'), 'ext_post_external_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('Accepted but additional info required'), 'stage': RequestExt, 'permissions': applicant_edit_permissions}, 'ext_rejected': {'display': gettext('Dismissed'), 'stage': RequestExt, 'permissions': no_permissions}}]
SingleStageCommunityDefinition
module-attribute
¶
SingleStageCommunityDefinition = [{DRAFT_STATE: {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT}, 'method': 'create_revision'}}, 'display': gettext('Draft'), 'stage': RequestCom, 'permissions': applicant_edit_permissions}}, {INITIAL_STATE: {'transitions': {'com_more_info': gettext('Request More Information'), 'com_open_call': 'Open Call (public)', 'com_internal_review': gettext('Open Review'), 'com_community_review': gettext('Open Community Review'), 'com_determination': gettext('Ready For Determination'), 'com_rejected': gettext('Dismiss')}, 'display': gettext('Need screening'), 'public': gettext('Application Received'), 'stage': RequestCom, 'permissions': default_permissions}, 'com_more_info': {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': RequestCom, 'permissions': applicant_edit_permissions}, 'com_open_call': {'transitions': {INITIAL_STATE: gettext('Need screening (revert)'), 'com_rejected': gettext('Dismiss')}, 'display': 'Open Call (public)', 'stage': RequestCom, 'permissions': staff_edit_permissions}}, {'com_internal_review': {'transitions': {'com_community_review': gettext('Open Community Review'), 'com_post_review_discussion': gettext('Close Review'), INITIAL_STATE: gettext('Need screening (revert)'), 'com_rejected': gettext('Dismiss')}, 'display': gettext('Internal Review'), 'public': format(org_short_name=ORG_SHORT_NAME), 'stage': RequestCom, 'permissions': default_permissions}, 'com_community_review': {'transitions': {'com_post_review_discussion': gettext('Close Review'), 'com_internal_review': gettext('Open Internal Review (revert)'), 'com_rejected': gettext('Dismiss')}, 'display': gettext('Community Review'), 'public': format(org_short_name=ORG_SHORT_NAME), 'stage': RequestCom, 'permissions': community_review_permissions}}, {'com_post_review_discussion': {'transitions': {'com_post_review_more_info': gettext('Request More Information'), 'com_external_review': gettext('Open External Review'), 'com_determination': gettext('Ready For Determination'), 'com_internal_review': gettext('Open Internal Review (revert)'), 'com_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': RequestCom, 'permissions': hidden_from_applicant_permissions}, 'com_post_review_more_info': {'transitions': {'com_post_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': RequestCom, 'permissions': applicant_edit_permissions}}, {'com_external_review': {'transitions': {'com_post_external_review_discussion': gettext('Close Review'), 'com_post_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('External Review'), 'stage': RequestCom, 'permissions': reviewer_review_permissions}}, {'com_post_external_review_discussion': {'transitions': {'com_post_external_review_more_info': gettext('Request More Information'), 'com_determination': gettext('Ready For Determination'), 'com_external_review': gettext('Open External Review (revert)'), 'com_almost': gettext('Accept but additional info required'), 'com_accepted': gettext('Accept'), 'com_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': RequestCom, 'permissions': hidden_from_applicant_permissions}, 'com_post_external_review_more_info': {'transitions': {'com_post_external_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': RequestCom, 'permissions': applicant_edit_permissions}}, {'com_determination': {'transitions': {'com_post_external_review_discussion': gettext('Ready For Discussion (revert)'), 'com_almost': gettext('Accept but additional info required'), 'com_accepted': gettext('Accept'), 'com_rejected': gettext('Dismiss')}, 'display': gettext('Ready for Determination'), 'permissions': hidden_from_applicant_permissions, 'stage': RequestCom}}, {'com_accepted': {'display': gettext('Accepted'), 'future': gettext('Application Outcome'), 'stage': RequestCom, 'permissions': staff_edit_permissions}, 'com_almost': {'transitions': {'com_accepted': gettext('Accept'), 'com_post_external_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('Accepted but additional info required'), 'stage': RequestCom, 'permissions': applicant_edit_permissions}, 'com_rejected': {'display': gettext('Dismissed'), 'stage': RequestCom, 'permissions': no_permissions}}]
DoubleStageDefinition
module-attribute
¶
DoubleStageDefinition = [{DRAFT_STATE: {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT}, 'method': 'create_revision'}}, 'display': gettext('Draft'), 'stage': Concept, 'permissions': applicant_edit_permissions}}, {INITIAL_STATE: {'transitions': {'concept_more_info': gettext('Request More Information'), 'concept_internal_review': gettext('Open Review'), 'concept_determination': gettext('Ready For Preliminary Determination'), 'invited_to_proposal': gettext('Invite to Proposal'), 'concept_rejected': gettext('Dismiss')}, 'display': gettext('Need screening'), 'public': gettext('Concept Note Received'), 'stage': Concept, 'permissions': default_permissions}, 'concept_more_info': {'transitions': {INITIAL_STATE: {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}, 'concept_rejected': gettext('Dismiss'), 'invited_to_proposal': gettext('Invite to Proposal'), 'concept_determination': gettext('Ready For Preliminary Determination')}, 'display': gettext('More information required'), 'stage': Concept, 'permissions': applicant_edit_permissions}}, {'concept_internal_review': {'transitions': {'concept_review_discussion': gettext('Close Review'), INITIAL_STATE: gettext('Need screening (revert)'), 'invited_to_proposal': gettext('Invite to Proposal')}, 'display': gettext('Internal Review'), 'public': format(org_short_name=ORG_SHORT_NAME), 'stage': Concept, 'permissions': default_permissions}}, {'concept_review_discussion': {'transitions': {'concept_review_more_info': gettext('Request More Information'), 'concept_determination': gettext('Ready For Preliminary Determination'), 'concept_internal_review': gettext('Open Review (revert)'), 'invited_to_proposal': gettext('Invite to Proposal'), 'concept_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': Concept, 'permissions': hidden_from_applicant_permissions}, 'concept_review_more_info': {'transitions': {'concept_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}, 'invited_to_proposal': gettext('Invite to Proposal')}, 'display': gettext('More information required'), 'stage': Concept, 'permissions': applicant_edit_permissions}}, {'concept_determination': {'transitions': {'concept_review_discussion': gettext('Ready For Discussion (revert)'), 'invited_to_proposal': gettext('Invite to Proposal'), 'concept_rejected': gettext('Dismiss')}, 'display': gettext('Ready for Preliminary Determination'), 'permissions': hidden_from_applicant_permissions, 'stage': Concept}}, {'invited_to_proposal': {'display': gettext('Concept Accepted'), 'future': gettext('Preliminary Determination'), 'transitions': {'draft_proposal': {'display': gettext('Progress'), 'method': 'progress_application', 'permissions': {STAFF, LEAD, ADMIN}, 'conditions': 'not_progressed'}}, 'stage': Concept, 'permissions': no_permissions}, 'concept_rejected': {'display': gettext('Dismissed'), 'stage': Concept, 'permissions': no_permissions}}, {'draft_proposal': {'transitions': {'proposal_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT}, 'method': 'create_revision'}, 'external_review': gettext('Open External Review'), 'proposal_determination': gettext('Ready For Final Determination'), 'proposal_rejected': gettext('Dismiss')}, 'display': gettext('Invited for Proposal'), 'stage': Proposal, 'permissions': applicant_edit_permissions}}, {'proposal_discussion': {'transitions': {'proposal_more_info': gettext('Request More Information'), 'proposal_internal_review': gettext('Open Review'), 'external_review': gettext('Open External Review'), 'proposal_determination': gettext('Ready For Final Determination'), 'proposal_rejected': gettext('Dismiss')}, 'display': gettext('Proposal Received'), 'stage': Proposal, 'permissions': default_permissions}, 'proposal_more_info': {'transitions': {'proposal_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}, 'external_review': gettext('Open External Review'), 'proposal_determination': gettext('Ready For Final Determination'), 'proposal_rejected': gettext('Dismiss')}, 'display': gettext('More information required'), 'stage': Proposal, 'permissions': applicant_edit_permissions}}, {'proposal_internal_review': {'transitions': {'post_proposal_review_discussion': gettext('Close Review'), 'proposal_discussion': gettext('Proposal Received (revert)')}, 'display': gettext('Internal Review'), 'public': format(org_short_name=ORG_SHORT_NAME), 'stage': Proposal, 'permissions': default_permissions}}, {'post_proposal_review_discussion': {'transitions': {'post_proposal_review_more_info': gettext('Request More Information'), 'external_review': gettext('Open External Review'), 'proposal_determination': gettext('Ready For Final Determination'), 'proposal_internal_review': gettext('Open Internal Review (revert)'), 'proposal_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': Proposal, 'permissions': hidden_from_applicant_permissions}, 'post_proposal_review_more_info': {'transitions': {'post_proposal_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}, 'external_review': gettext('Open External Review')}, 'display': gettext('More information required'), 'stage': Proposal, 'permissions': applicant_edit_permissions}}, {'external_review': {'transitions': {'post_external_review_discussion': gettext('Close Review'), 'post_proposal_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('External Review'), 'stage': Proposal, 'permissions': reviewer_review_permissions}}, {'post_external_review_discussion': {'transitions': {'post_external_review_more_info': gettext('Request More Information'), 'proposal_determination': gettext('Ready For Final Determination'), 'external_review': gettext('Open External Review (revert)'), 'proposal_almost': gettext('Accept but additional info required'), 'proposal_accepted': gettext('Accept'), 'proposal_rejected': gettext('Dismiss')}, 'display': gettext('Ready For Discussion'), 'stage': Proposal, 'permissions': hidden_from_applicant_permissions}, 'post_external_review_more_info': {'transitions': {'post_external_review_discussion': {'display': gettext('Submit'), 'permissions': {APPLICANT, STAFF, LEAD, ADMIN}, 'method': 'create_revision'}}, 'display': gettext('More information required'), 'stage': Proposal, 'permissions': applicant_edit_permissions}}, {'proposal_determination': {'transitions': {'post_external_review_discussion': gettext('Ready For Discussion (revert)'), 'proposal_almost': gettext('Accept but additional info required'), 'proposal_accepted': gettext('Accept'), 'proposal_rejected': gettext('Dismiss')}, 'display': gettext('Ready for Final Determination'), 'permissions': hidden_from_applicant_permissions, 'stage': Proposal}}, {'proposal_accepted': {'display': gettext('Accepted'), 'future': gettext('Final Determination'), 'stage': Proposal, 'permissions': staff_edit_permissions}, 'proposal_almost': {'transitions': {'proposal_accepted': gettext('Accept'), 'post_external_review_discussion': gettext('Ready For Discussion (revert)')}, 'display': gettext('Accepted but additional info required'), 'stage': Proposal, 'permissions': applicant_edit_permissions}, 'proposal_rejected': {'display': gettext('Dismissed'), 'stage': Proposal, 'permissions': no_permissions}}]
Request
module-attribute
¶
Request = Workflow('Request', 'single', **phase_data(SingleStageDefinition))
RequestExternal
module-attribute
¶
RequestExternal = Workflow('Request with external review', 'single_ext', **phase_data(SingleStageExternalDefinition))
RequestCommunity
module-attribute
¶
RequestCommunity = Workflow('Request with community review', 'single_com', **phase_data(SingleStageCommunityDefinition))
ConceptProposal
module-attribute
¶
ConceptProposal = Workflow('Concept & Proposal', 'double', **phase_data(DoubleStageDefinition))
WORKFLOWS
module-attribute
¶
WORKFLOWS = {admin_name: Request, admin_name: RequestExternal, admin_name: RequestCommunity, admin_name: ConceptProposal}
active_statuses
module-attribute
¶
active_statuses = [status for (status, gettext) in PHASES if 'accepted' not in status and 'rejected' not in status and 'invited' not in status]
DETERMINATION_PHASES
module-attribute
¶
DETERMINATION_PHASES = [phase_name for (phase_name, gettext) in PHASES if '_discussion' in phase_name]
DETERMINATION_RESPONSE_PHASES
module-attribute
¶
DETERMINATION_RESPONSE_PHASES = ['post_review_discussion', 'concept_review_discussion', 'post_external_review_discussion', 'ext_post_external_review_discussion', 'com_post_external_review_discussion']
PHASES_MAPPING
module-attribute
¶
PHASES_MAPPING = {'received': {'name': gettext('Received'), 'statuses': [INITIAL_STATE, 'proposal_discussion']}, 'internal-review': {'name': gettext('Internal Review'), 'statuses': phases_matching('internal_review')}, 'in-discussion': {'name': gettext('Ready for Discussion'), 'statuses': phases_matching('discussion', exclude=[INITIAL_STATE, 'proposal_discussion'])}, 'more-information': {'name': gettext('More Information Requested'), 'statuses': phases_matching('more_info')}, 'invited-for-proposal': {'name': gettext('Invited for Proposal'), 'statuses': ['draft_proposal']}, 'external-review': {'name': gettext('External Review'), 'statuses': phases_matching('external_review')}, 'ready-for-determination': {'name': gettext('Ready for Determination'), 'statuses': phases_matching('determination')}, 'accepted': {'name': gettext('Accepted'), 'statuses': phases_matching('accepted')}, 'dismissed': {'name': gettext('Dismissed'), 'statuses': phases_matching('rejected')}}
UserPermissions
¶
Workflow
¶
Bases: dict
Source code in hypha/apply/funds/workflow.py
phases_for
¶
previous_visible
¶
Find the latest phase that the user has view permissions for
Source code in hypha/apply/funds/workflow.py
Phase
¶
Phase Names: display_name = phase name displayed to staff members in the system public_name = phase name displayed to applicants in the system future_name = phase_name displayed to applicants if they haven't passed this stage
Source code in hypha/apply/funds/workflow.py
Stage
¶
make_permissions
¶
unpack_phases
¶
phase_data
¶
get_stage_change_actions
¶
Source code in hypha/apply/funds/workflow.py
get_review_active_statuses
¶
Source code in hypha/apply/funds/workflow.py
get_review_statuses
¶
Source code in hypha/apply/funds/workflow.py
get_ext_review_statuses
¶
get_ext_or_higher_statuses
¶
Returns a set of all the statuses for all workflow which are External Review or higher than that.