def finish_action(self): assert self.values[u'action'] in Action.OBLIGEE_ACTION_TYPES assert not self.email or self.values[u'action'] in Action.OBLIGEE_EMAIL_ACTION_TYPES assert self.values[u'branch'].can_add_action(self.values[u'action']) last_action_dd = self.values.get(u'last_action_dd', None) if last_action_dd and not self.values[u'branch'].last_action.delivered_date: self.values[u'branch'].last_action.delivered_date = last_action_dd self.values[u'branch'].last_action.save(update_fields=[u'delivered_date']) action = Action.create( branch=self.values[u'branch'], type=self.values[u'action'], email=self.email if self.email else None, subject=self.email.subject if self.email else u'', content=self.email.text if self.email else u'', file_number=self.values[u'file_number'], delivered_date=self.values[u'delivered_date'], legal_date=self.values[u'legal_date'], extension=self.values.get(u'extension', None), disclosure_level=self.values.get(u'disclosure_level', None), refusal_reason=self.values.get(u'refusal_reason', None), advanced_to=self.values.get(u'advanced_to', None), attachments=self.email.attachments if self.email else self.values[u'attachments'], ) action.save() if self.email: self.inforequestemail.type = InforequestEmail.TYPES.OBLIGEE_ACTION self.inforequestemail.save(update_fields=[u'type']) return action.get_absolute_url()
def finish(self): self.branch.add_expiration_if_expired() action = Action.create( branch=self.branch, type=Action.TYPES.APPEAL, subject=self.values[u'subject'], content=self.values[u'content'], content_type=Action.CONTENT_TYPES.HTML, sent_date=self.values[u'legal_date'], legal_date=self.values[u'legal_date'], ) action.save() return action.get_absolute_url()
def finish(self): today = local_today() action = Action.create( branch=self.branch, type=Action.TYPES.CLARIFICATION_RESPONSE, subject=self.values[u'subject'], content=self.values[u'content'], sent_date=today, legal_date=today, attachments=self.values[u'attachments'], ) action.save() action.send_by_email() return action.get_absolute_url()
def finish(self): today = local_today() action = Action.create( branch=self.branch, type=Action.TYPES.CLARIFICATION_RESPONSE, subject=self.values[u'subject'], content=self.values[u'content'], sent_date=today, legal_date=today, attachments=self.values[u'attachments'], ) action.save() action.send_by_email() return action.get_absolute_url()
def finish_action(self): assert self.values[u'action'] in Action.OBLIGEE_ACTION_TYPES assert not self.email or self.values[ u'action'] in Action.OBLIGEE_EMAIL_ACTION_TYPES assert self.values[u'branch'].can_add_action(self.values[u'action']) last_action_dd = self.values.get(u'last_action_dd', None) if last_action_dd and not self.values[ u'branch'].last_action.delivered_date: self.values[u'branch'].last_action.delivered_date = last_action_dd self.values[u'branch'].last_action.save( update_fields=[u'delivered_date']) action = Action.create( branch=self.values[u'branch'], type=self.values[u'action'], email=self.email if self.email else None, subject=self.email.subject if self.email else u'', content=self.email.text if self.email else u'', file_number=self.values[u'file_number'], delivered_date=self.values[u'delivered_date'], legal_date=self.values[u'legal_date'], extension=self.values.get(u'extension', None), disclosure_level=self.values.get(u'disclosure_level', None), refusal_reason=self.values.get(u'refusal_reason', None), advanced_to=self.values.get(u'advanced_to', None), attachments=self.email.attachments if self.email else self.values[u'attachments'], ) action.save() if self.email: self.inforequestemail.type = InforequestEmail.TYPES.OBLIGEE_ACTION self.inforequestemail.save(update_fields=[u'type']) return action.get_absolute_url()