Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4 Create new arguments #217

Merged
merged 18 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove redundant verifier
  • Loading branch information
seporterfield committed Jun 25, 2024
commit 9f6c1fc65c300048c0ccac857f1d6088f949f166
9 changes: 1 addition & 8 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import serializers

from .models import POSTS_TYPES, Posts, Tags, UserProfile
from .models import Posts, Tags, UserProfile


class TagSerializer(serializers.ModelSerializer):
Expand All @@ -14,13 +14,6 @@ class Meta:
model = Posts
fields = "__all__"

def validate_type(self, value):
if (
value not in list(zip(*POSTS_TYPES))[0]
): # validate against post types in models.py
raise serializers.ValidationError("Invalid post type")
return value


class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
Expand Down
Loading