def apply_action_intent(self, case_action_intent): if not case_action_intent.is_deprecation: # for now we only allow commtrack actions to be processed this way so just assert that's the case assert case_action_intent.action_type == CASE_ACTION_COMMTRACK transaction = CaseTransaction.ledger_transaction(self.case, case_action_intent.form) if transaction not in self.case.get_tracked_models_to_create(CaseTransaction): self.case.track_create(transaction)
def apply_action_intents(self, primary_intent, deprecation_intent=None): # for now we only allow commtrack actions to be processed this way so just assert that's the case assert primary_intent.action_type == CASE_ACTION_COMMTRACK transaction = CaseTransaction.ledger_transaction(self.case, primary_intent.form) if deprecation_intent: assert transaction.is_saved() elif transaction not in self.case.get_tracked_models_to_create(CaseTransaction): # hack: clear the sync log id so this modification always counts # since consumption data could change server-side transaction.sync_log_id = None self.case.track_create(transaction)