From fbc8a17e6aa9c6e5fda66da8f1467f5f1aa367f1 Mon Sep 17 00:00:00 2001 From: i701 Date: Mon, 28 Jul 2025 09:39:02 +0500 Subject: [PATCH] =?UTF-8?q?fix(user):=20remove=20agreement=20file=20valida?= =?UTF-8?q?tion=20from=20UserUpdateAPIView=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/views.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/api/views.py b/api/views.py index b1f8936..d3db78d 100644 --- a/api/views.py +++ b/api/views.py @@ -324,26 +324,6 @@ class UserUpdateAPIView(StaffEditorPermissionMixin, generics.UpdateAPIView): data=request.data, partial=True, ) - agreement_file = request.data.get("agreement_file") - if not agreement_file: - return Response( - {"message": "Agreement file is required."}, - status=status.HTTP_400_BAD_REQUEST, - ) - if agreement_file.size > 10 * 1024 * 1024: # 5 MB limit - return Response( - {"message": "File size exceeds 10 MB limit."}, - status=status.HTTP_400_BAD_REQUEST, - ) - if agreement_file.content_type not in [ - "application/pdf", - ]: - return Response( - {"message": "Invalid file type. Only PDF files are allowed."}, - status=status.HTTP_400_BAD_REQUEST, - ) - if agreement_file: - user.agreement = agreement_file serializer.is_valid(raise_exception=True) user.save() return super().update(request, *args, **kwargs)