From 24b06d2a015ed1dd7de5f8fedee01487132fe61f Mon Sep 17 00:00:00 2001 From: sniedzielski <52816247+sniedzielski@users.noreply.github.com> Date: Thu, 16 May 2024 15:59:07 +0200 Subject: [PATCH] CM-833: added beneficiary as a matching model to generic fk reporter type (#17) --- grievance_social_protection/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grievance_social_protection/models.py b/grievance_social_protection/models.py index 93a72ef..d73692c 100644 --- a/grievance_social_protection/models.py +++ b/grievance_social_protection/models.py @@ -8,11 +8,12 @@ from core import models as core_models from core.models import HistoryBusinessModel, User, HistoryModel from individual.models import Individual +from social_protection.models import Beneficiary def check_if_user_or_individual(generic_field): - if not isinstance(generic_field, (User, Individual)): - raise ValueError('Reporter must be either a User or an Individual.') + if not isinstance(generic_field, (User, Individual, Beneficiary)): + raise ValueError('Reporter must be either a User or a Beneficiary or an Individual.') class Ticket(HistoryBusinessModel):