Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore Num Assign NameStore Num Assign NameStore Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str attr If BoolOpAnd NameLoad CompareNotEq NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If NameLoad body Expr Call NameLoad NameLoad Return NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr For NameStore SubscriptLoad NameLoad Index Str body Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad SubscriptLoad NameLoad Index Str Index Str If CompareEq SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr orelse If CompareEq SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr body For NameStore SubscriptLoad NameLoad Index Str body Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr If CompareEq AttributeLoad Call NameLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr orelse Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad SubscriptLoad NameLoad Index Str Index Str If CompareEq SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr orelse If CompareEq SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad Str Assign NameStore Dict Str Str AttributeLoad Call NameLoad NameLoad attr ListLoad For NameStore Call AttributeLoad Call NameLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Dict Str Str Str AttributeLoad Call NameLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr ListLoad For NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str attr body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Str Assign NameStore SubscriptLoad NameLoad Index AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore SubscriptLoad NameLoad Index AttributeLoad AttributeLoad NameLoad attr attr If CompareEq Call NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr orelse If BoolOpOr NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Dict Str Str AttributeLoad Call NameLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body If BoolOpOr CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareGtE AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign NameStore ListComp NameLoad comprehension NameStore SubscriptLoad NameLoad Index Str comprehension NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad keyword NameLoad attr keyword SubscriptLoad NameLoad Index AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad Num body Return AttributeLoad AttributeLoad NameLoad attr attr orelse If NameLoad body Return AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq NameLoad Num body Return AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr If CompareEq NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return AttributeLoad AttributeLoad NameLoad attr attr orelse Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore DictComp AttributeLoad NameLoad attr ListLoad comprehension NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Str attr SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str Return NameLoad decorator_list
N/A enum Enum django.db transaction orchestra.core.errors InvalidRevertError orchestra.models Iteration orchestra.models Task orchestra.models TaskAssignment orchestra.project_api.serializers IterationSerializer orchestra.project_api.serializers TaskSerializer orchestra.project_api.serializers TaskAssignmentSerializer orchestra.utils.task_properties assignment_history orchestra.utils.task_properties get_iteration_history orchestra.utils.task_properties get_latest_iteration RevertChange N/A Enum N/A N/A UNCHANGED 0 N/A REVERTED 1 N/A DELETED 2 N/A revert_task_to_iteration N/A N/A task_id iteration_id revert_before commit N/A False False N/A N/A 
    Reverts a task to or before a specified iteration.

    Args:
        task (orchestra.models.Task):
            The ID of the task to be reverted.
        iteration_id (datetime.datetime):
            The ID of the iteration before which to revert the task.
        revert_before (bool):
            If `revert_before` is indicated, the task will be reverted to a
            state before the specified iteration was created; otherwise, it
            will be reverted to a state in which the iteration is processing.
            This can only be true for the first iteration in an assignment.
        commit (bool):
            Determines whether the revert is actually carried out;
            otherwise, an audit trail is passively generated.

    Returns:
        audit (dict):
            An audit trail for the revert, e.g.,
            {
                'task': {...},
                'assignments': [
                    {
                        # worker_0 assignment
                        'assignment': {...},
                        'change': 1,
                        'iterations': [
                            {
                                'iteration': {...},
                                'change': 2
                            }
                        ]
                    },
                    {
                        # worker_1 assignment
                        'assignment': {...},
                        'change': 2,
                        'iterations': []
                    }
                ],
            }
     N/A task N/A N/A N/A Task objects get id task_id N/A revert_iteration N/A N/A N/A Iteration objects get id iteration_id N/A first_iteration N/A N/A N/A N/A N/A N/A revert_iteration assignment iterations order_by start_datetime first N/A N/A revert_before N/A revert_iteration first_iteration N/A N/A N/A InvalidRevertError Cannot revert before an iteration that isn't the first of its assignment. N/A task_audit N/A _build_revert_audit task revert_iteration revert_before N/A commit N/A N/A N/A _revert_task_from_audit task_audit N/A task_audit N/A N/A transaction atomic _revert_task_from_audit N/A N/A task_audit N/A N/A N/A task N/A N/A N/A Task objects get id N/A N/A task_audit N/A task N/A id N/A N/A task status N/A task_audit N/A reverted_status N/A N/A N/A task save N/A assignment_audit N/A task_audit N/A assignments N/A N/A N/A _revert_assignment_from_audit assignment_audit N/A _revert_assignment_from_audit N/A N/A assignment_audit N/A N/A N/A assignment N/A N/A N/A TaskAssignment objects get id N/A N/A assignment_audit N/A assignment N/A id N/A N/A N/A assignment_audit N/A change N/A N/A RevertChange DELETED value N/A N/A N/A N/A assignment delete N/A N/A N/A N/A assignment_audit N/A change N/A N/A RevertChange REVERTED value N/A N/A iteration_audit N/A assignment_audit N/A iterations N/A N/A N/A _revert_iteration_from_audit iteration_audit N/A N/A N/A assignment refresh_from_db N/A N/A N/A N/A get_latest_iteration assignment status N/A N/A Iteration Status PROCESSING N/A N/A N/A assignment status N/A N/A TaskAssignment Status PROCESSING N/A N/A N/A assignment status N/A N/A TaskAssignment Status SUBMITTED N/A N/A N/A assignment save N/A assignment N/A _revert_iteration_from_audit N/A N/A iteration_audit N/A N/A N/A iteration N/A N/A N/A Iteration objects get id N/A N/A iteration_audit N/A iteration N/A id N/A N/A N/A iteration_audit N/A change N/A N/A RevertChange DELETED value N/A N/A N/A N/A iteration delete N/A N/A N/A N/A iteration_audit N/A change N/A N/A RevertChange REVERTED value N/A N/A iteration N/A N/A N/A Iteration objects get id N/A N/A iteration_audit N/A iteration N/A id N/A N/A iteration status N/A N/A Iteration Status PROCESSING N/A N/A iteration end_datetime None N/A N/A iteration submitted_data N/A N/A N/A N/A iteration save N/A _build_revert_audit N/A N/A task revert_iteration revert_before N/A N/A N/A N/A N/A task status N/A N/A Task Status ABORTED N/A N/A N/A InvalidRevertError Cannot revert aborted task. N/A task_audit N/A task assignments N/A N/A TaskSerializer task data N/A N/A assignment N/A N/A N/A assignment_history task all N/A N/A assignment_audit N/A _build_assignment_revert_audit assignment revert_iteration revert_before N/A N/A N/A N/A task_audit N/A assignments append assignment_audit N/A N/A task_audit N/A reverted_status N/A _reverted_task_status task_audit revert_before N/A task_audit N/A _build_assignment_revert_audit N/A N/A assignment revert_iteration revert_before N/A N/A N/A assignment_audit N/A assignment change iterations N/A N/A TaskAssignmentSerializer assignment data N/A N/A RevertChange UNCHANGED value N/A N/A iteration N/A N/A N/A N/A N/A assignment iterations order_by start_datetime all N/A N/A iteration_audit N/A _build_iteration_revert_audit iteration revert_iteration revert_before N/A N/A N/A N/A assignment_audit N/A iterations append iteration_audit N/A changed_iterations N/A _parse_changed_items N/A assignment_audit N/A iterations iteration N/A deleted_iterations N/A changed_iterations N/A N/A N/A RevertChange DELETED value N/A reverted_iterations N/A changed_iterations N/A N/A N/A RevertChange REVERTED value N/A N/A N/A len deleted_iterations N/A N/A N/A assignment iterations count N/A N/A N/A assignment_audit N/A change N/A N/A RevertChange DELETED value N/A N/A N/A deleted_iterations reverted_iterations N/A N/A N/A assignment_audit N/A change N/A N/A RevertChange REVERTED value N/A assignment_audit N/A _build_iteration_revert_audit N/A N/A iteration revert_iteration revert_before N/A N/A N/A iteration_audit N/A iteration change N/A N/A IterationSerializer iteration data N/A N/A RevertChange UNCHANGED value N/A revert_before N/A N/A N/A N/A N/A iteration id N/A revert_iteration id N/A N/A iteration start_datetime N/A revert_iteration start_datetime N/A N/A N/A iteration_audit N/A change N/A N/A RevertChange DELETED value N/A N/A N/A N/A iteration id N/A revert_iteration id N/A N/A N/A iteration_audit N/A change N/A N/A RevertChange REVERTED value N/A N/A N/A N/A iteration start_datetime N/A revert_iteration start_datetime N/A N/A N/A iteration_audit N/A change N/A N/A RevertChange DELETED value N/A iteration_audit N/A _reverted_task_status N/A N/A task_audit revert_before N/A N/A N/A 
    Reverts the status of an otherwise-reverted task.

    Args:
        task (dict):
            Audit containing task data to be changed upon revert.

    Returns:
        status (orchestra.models.Task.Status):
            The status of the task if it were reverted.
     N/A task N/A N/A N/A Task objects get id N/A N/A task_audit N/A task N/A id N/A flattened_iterations N/A iteration_audit N/A assignment_audit N/A task_audit N/A assignments N/A iteration_audit N/A assignment_audit N/A iterations N/A changed_items N/A _parse_changed_items flattened_iterations iteration N/A latest_iterations N/A N/A N/A get_iteration_history task reverse True exclude id__in N/A changed_items N/A N/A N/A RevertChange DELETED value N/A num_iterations N/A N/A latest_iterations count N/A N/A num_iterations 0 N/A N/A N/A N/A Task Status AWAITING_PROCESSING N/A N/A revert_before N/A N/A N/A N/A Task Status PENDING_REVIEW N/A N/A N/A num_iterations 1 N/A N/A N/A N/A Task Status PROCESSING N/A N/A previous_status N/A N/A latest_iterations N/A 1 status N/A N/A previous_status N/A N/A Iteration Status REQUESTED_REVIEW N/A N/A N/A N/A Task Status REVIEWING N/A N/A N/A N/A Task Status POST_REVIEW_PROCESSING N/A _parse_changed_items N/A N/A items item_key N/A N/A N/A changed_items N/A N/A change value N/A N/A change RevertChange N/A item items N/A N/A N/A N/A N/A changed_items N/A N/A item N/A change append N/A N/A item N/A item_key N/A id N/A changed_items N/A