Skip to content

Commit

Permalink
Merge branch 'dev' into feature/362-unit-test-for-tag-search
Browse files Browse the repository at this point in the history
  • Loading branch information
aykutkantas authored Dec 28, 2023
2 parents 3ac4012 + e5bbeb0 commit 8d8e832
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,13 +618,13 @@ def put(self, request):
# Get the file from the request
uploaded_file = request.FILES.get('profile_photo')

# Check the file size against the limit in settings
# Check the file size against the limit in settings
max_size = getattr(settings, 'FILE_UPLOAD_MAX_MEMORY_SIZE', None)
logger.warning(f"maxsize {max_size}")
logger.warning(f"file {uploaded_file}")
logger.warning(f"filesize {uploaded_file.size}")
if max_size and uploaded_file.size > max_size:
return Response({'success': False, 'msg': 'File size exceeds limit'}, status=status.HTTP_400_BAD_REQUEST)
return Response({'success': False, 'msg': 'Your photo is too big. Please use a smaller file.'}, status=status.HTTP_400_BAD_REQUEST)

# Check if a file is provided
if not isinstance(uploaded_file, InMemoryUploadedFile):
Expand Down

0 comments on commit 8d8e832

Please sign in to comment.