Skip to content

Commit

Permalink
Disabled django image validation (#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
f213 authored Sep 21, 2024
1 parent f36c116 commit eea5d7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 1 addition & 0 deletions src/apps/homework/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class Meta:

class AnswerImageSerializer(serializers.ModelSerializer):
author = serializers.HiddenField(default=serializers.CurrentUserDefault())
image = serializers.FileField()

class Meta:
model = AnswerImage
Expand Down
13 changes: 0 additions & 13 deletions src/apps/homework/tests/homework/api/tests_answer_image_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ def test_response(api, factory):
assert response["image"].endswith(".gif"), "Contains given extension"


def test_wrong_extension(api, factory):
response = api.post(
"/api/v2/homework/answers/image/",
{
"image": factory.image(name="ev1l.exe"),
},
format="multipart",
expected_status_code=400,
)

assert "exe" in response["image"][0]


def test_no_anon(anon, factory):
anon.post(
"/api/v2/homework/answers/image/",
Expand Down

0 comments on commit eea5d7d

Please sign in to comment.