Skip to content

Commit

Permalink
content type to lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvyshnevska committed Jun 23, 2024
1 parent 324e900 commit 69dc59d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions BackEnd/images/tests/test_add_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_post_valid_banner_authorized(self):
"image_type": "banner",
"image_path": AnyStr(),
"created_by": 1,
"content_type": "PNG",
"content_type": "png",
"image_size": AnyInt(),
"hash_md5": AnyStr(),
"is_approved": False,
Expand All @@ -109,7 +109,7 @@ def test_post_valid_logo_authorized(self):
"image_type": "logo",
"image_path": AnyStr(),
"created_by": 1,
"content_type": "PNG",
"content_type": "png",
"image_size": AnyInt(),
"hash_md5": AnyStr(),
"is_approved": False,
Expand Down
2 changes: 1 addition & 1 deletion BackEnd/images/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def perform_create(self, serializer):
hash_md5 = md5(img.tobytes()).hexdigest()
serializer.save(
image_type=self.kwargs.get("image_type"),
content_type=image.name.split(".")[-1],
content_type=image.name.split(".")[-1].lower(),
hash_md5=hash_md5,
image_size=image.size,
created_by=self.request.user,
Expand Down

0 comments on commit 69dc59d

Please sign in to comment.