Skip to content

Commit

Permalink
CM-833: added beneficiary as a matching model to generic fk reporter …
Browse files Browse the repository at this point in the history
…type (#17)
  • Loading branch information
sniedzielski authored May 16, 2024
1 parent 54e3632 commit 24b06d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grievance_social_protection/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 24b06d2

Please sign in to comment.