From 3aaad96caa4ff5baf864d2e60bc70d48b29886a7 Mon Sep 17 00:00:00 2001 From: lsabor Date: Wed, 20 Nov 2024 11:22:52 -0800 Subject: [PATCH] search vs slug rather than name --- posts/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/serializers.py b/posts/serializers.py index cbe605a34f..6035684b02 100644 --- a/posts/serializers.py +++ b/posts/serializers.py @@ -251,7 +251,7 @@ def validate_public_figure(self, value: int): def validate_news_type(self, value: str): try: return Project.objects.get( - name__iexact=value, type=Project.ProjectTypes.NEWS_CATEGORY + slug__iexact=value, type=Project.ProjectTypes.NEWS_CATEGORY ) except Project.DoesNotExist: raise ValidationError("Slug does not exist")