diff --git a/g2p_program_documents/models/entitlement_manager.py b/g2p_program_documents/models/entitlement_manager.py index 7f0db54e..aff67357 100644 --- a/g2p_program_documents/models/entitlement_manager.py +++ b/g2p_program_documents/models/entitlement_manager.py @@ -12,5 +12,7 @@ def prepare_entitlements(self, cycle, beneficiaries): ents = super(DefaultEntitlementManagerForDocument, self).prepare_entitlements( cycle, beneficiaries ) - ents.copy_documents_from_beneficiary() + + if ents: + ents.copy_documents_from_beneficiary() return ents diff --git a/g2p_program_registrant_info/models/entitlement_manager.py b/g2p_program_registrant_info/models/entitlement_manager.py index 99174086..513cda3e 100644 --- a/g2p_program_registrant_info/models/entitlement_manager.py +++ b/g2p_program_registrant_info/models/entitlement_manager.py @@ -12,10 +12,11 @@ def prepare_entitlements(self, cycle, beneficiaries): ents = super(DefaultEntitlementManagerRegInfo, self).prepare_entitlements( cycle, beneficiaries ) - for ent in ents: - self.env[ - "g2p.program.registrant_info" - ].assign_reg_info_to_entitlement_from_membership(ent) + if ents: + for ent in ents: + self.env[ + "g2p.program.registrant_info" + ].assign_reg_info_to_entitlement_from_membership(ent) return ents def approve_entitlements(self, entitlements): diff --git a/g2p_program_registrant_info/models/program_registrant_info.py b/g2p_program_registrant_info/models/program_registrant_info.py index 29f48e15..a8f9a97b 100644 --- a/g2p_program_registrant_info/models/program_registrant_info.py +++ b/g2p_program_registrant_info/models/program_registrant_info.py @@ -140,4 +140,4 @@ def open_new_tab(self): "target": "new", "flags": {"mode": "readonly"}, "context": {"create": False, "edit": False}, - } \ No newline at end of file + }