Skip to content

Utils

hypha.apply.projects.forms.utils

get_project_status_options

get_project_status_options()

Gets settable project status options

Filters out complete & internal approval statuses as there isn't value in being able to set these

Source code in hypha/apply/projects/forms/utils.py
def get_project_status_options() -> List[Tuple[str, str]]:
    """Gets settable project status options

    Filters out complete & internal approval statuses as there isn't value in
    being able to set these
    """
    return [
        status
        for status in PROJECT_STATUS_CHOICES
        if status[0] not in [COMPLETE, INTERNAL_APPROVAL]
    ]

get_project_default_status

get_project_default_status()

Gets the default project status based off the settings

If the PROJECTS_DEFAULT_STATUS setting is invalid, status will fall back to draft

Source code in hypha/apply/projects/forms/utils.py
def get_project_default_status() -> Tuple[str, str]:
    """Gets the default project status based off the settings

    If the `PROJECTS_DEFAULT_STATUS` setting is invalid, status will fall back
    to draft
    """
    return next(
        (
            status
            for status in PROJECT_STATUS_CHOICES
            if status[0] == settings.PROJECTS_DEFAULT_STATUS
        ),
        PROJECT_STATUS_CHOICES[0],
    )