Skip to content

Commit

Permalink
welcome to an episode of many=true breaks prod!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Dec 3, 2023
1 parent b2791c2 commit 408c2e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/api/serializers/custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ def __init__(self, **kwargs):
self.default_error_messages.update(default_error_messages)

class UserOrganizationField(OrganizationField):
def to_representation(self, value):
return OrganizationSerializer(value, many=True).data if value else None

def to_internal_value(self, data):
if data is None:
return None
Expand All @@ -217,6 +220,7 @@ def to_internal_value(self, data):
"invalid", message=f"Organization with ID {missing_id} does not exist."
)
return Organization.objects.filter(id__in=data)


class TagRelatedField(serializers.MultipleChoiceField):
"""
Expand Down

0 comments on commit 408c2e6

Please sign in to comment.