Skip to content

Commit

Permalink
Update api/api/serializers/media_serializers.py
Browse files Browse the repository at this point in the history
Co-authored-by: Staci Mullins <[email protected]>
  • Loading branch information
obulat and stacimc committed Sep 12, 2023
1 parent 659bb5d commit fbb1cec
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions api/api/serializers/media_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,7 @@ def validate_source(self, value):
def validate(self, data):
data = super().validate(data)
if "creator" in self.initial_data and "source" not in self.initial_data:
raise serializers.ValidationError(
"Cannot set `source` without `creator`. "
"Use both of these or neither of them."
)
raise serializers.ValidationError("Cannot set `creator` without `source`. ")
if not data.get("source") and not data.get("creator") and not data.get("tag"):
raise serializers.ValidationError(
"At least one of `source`, `creator` or `tag` must be "
Expand Down

0 comments on commit fbb1cec

Please sign in to comment.