def add_orgs_to_sub(self, *orgs): sub = self.extract_sub() if sub and orgs: applications = [ intake_models.Application(form_submission=sub, organization_id=org_id) for org_id in coerce_to_ids(orgs) ] intake_models.Application.objects.bulk_create(applications)
def add_orgs_to_sub(self, *orgs): sub = self.extract_sub() if sub and orgs: applications = [ intake_models.Application( form_submission=sub, organization_id=org_id) for org_id in coerce_to_ids(orgs) ] intake_models.Application.objects.bulk_create(applications)
def add_orgs_to_sub(self, *orgs): args, kwargs = self._constructor_args if len(args) == 1 and orgs: if isinstance(args[0], intake_models.FormSubmission): sub = args[0] applications = [ intake_models.Application(form_submission=sub, organization_id=org_id) for org_id in coerce_to_ids(orgs) ] intake_models.Application.objects.bulk_create(applications)