From a2f4be142b6025b4e972156ae92d36e826651b21 Mon Sep 17 00:00:00 2001 From: MohamedHamed12 Date: Wed, 15 May 2024 07:26:25 +0300 Subject: [PATCH 1/4] add hard delete soft deleted --- project/accounts/serializers/doctor.py | 6 +- project/accounts/serializers/employee.py | 6 +- project/accounts/serializers/patient.py | 6 +- project/accounts/tests/test_delete.py | 169 +++++++++++++---------- project/accounts/tests/test_doctor.py | 54 ++++++++ project/accounts/urls.py | 19 ++- project/accounts/views/doctor.py | 19 ++- project/accounts/views/employee.py | 19 ++- project/accounts/views/patient.py | 18 ++- project/visit/tests/test_delete.py | 13 +- project/visit/urls.py | 14 +- project/visit/views/attachment.py | 52 +++---- project/visit/views/visit.py | 30 ++-- 13 files changed, 271 insertions(+), 154 deletions(-) diff --git a/project/accounts/serializers/doctor.py b/project/accounts/serializers/doctor.py index d1ddba9..b34e3dd 100644 --- a/project/accounts/serializers/doctor.py +++ b/project/accounts/serializers/doctor.py @@ -9,7 +9,11 @@ class Meta: fields = '__all__' - + def validate_national_id(self,value): + user=User.objects.filter(username=value) + if user: + raise serializers.ValidationError("national id exits") + return value diff --git a/project/accounts/serializers/employee.py b/project/accounts/serializers/employee.py index 2d92c0d..d11f72f 100644 --- a/project/accounts/serializers/employee.py +++ b/project/accounts/serializers/employee.py @@ -7,7 +7,11 @@ class EmployeeSerializer(serializers.ModelSerializer): class Meta: model = Employee fields = '__all__' - + def validate_national_id(self,value): + user=User.objects.filter(username=value) + if user: + raise serializers.ValidationError("national id exits") + return value diff --git a/project/accounts/serializers/patient.py b/project/accounts/serializers/patient.py index dd7cf05..54f14eb 100644 --- a/project/accounts/serializers/patient.py +++ b/project/accounts/serializers/patient.py @@ -27,7 +27,11 @@ def validate_address(self, value): # print(value,address_serializer.data) return value - + def validate_national_id(self,value): + user=User.objects.filter(username=value) + if user: + raise serializers.ValidationError("national id exits") + return value diff --git a/project/accounts/tests/test_delete.py b/project/accounts/tests/test_delete.py index 7df78dc..c58345d 100644 --- a/project/accounts/tests/test_delete.py +++ b/project/accounts/tests/test_delete.py @@ -37,16 +37,29 @@ def test_delete_patient_restore(self): url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - data={ - 'id':patient['id'] - } - url=reverse('patient-restore') + + url=reverse('patient-restore',kwargs={'pk':patient['id']}) response = self.client.post( - url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token,data=data) + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 200) self.assertEqual(Patient.objects.count(), 1) self.assertEqual(len( Patient.deleted_objects.all()), 0) + def test_delete_hard_after_soft(self): + patient, patient_token = self.create_patient(self.staff_token,national_id='22222222222223',full_name='test2') + self.assertEqual(Patient.objects.count(), 1) + url='/accounts/patient/{}/?method=soft'.format(patient['id']) + response = self.client.delete( + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + + self.assertEqual(response.status_code, 204) + url=reverse('deleted-patient-delete',kwargs={'pk':patient['id']}) + response = self.client.delete( + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + + self.assertEqual(response.status_code, 204) + self.assertEqual(Patient.objects.count(), 0) + self.assertEqual(len( Patient.deleted_objects.all()), 0) def test_delete_patient_get_deleted(self): patient, patient_token = self.create_patient(self.staff_token,national_id='22222222222225',full_name='test2') @@ -61,120 +74,124 @@ def test_delete_patient_get_deleted(self): self.assertEqual(response.status_code, 200) # print(response.data) self.assertEqual(len(response.data['results']), 1) - -class EmployeeDeleteTestCase(TestSetup): +class DoctorDeleteTestCase(TestSetup): def setUp(self) -> None: super().setUp() self.staff, self.staff_token = self.create_staff() + self.doctor, self.doctor_token = self.create_doctor(self.staff_token) - - def test_delete_employee(self): - employee, employee_token = self.create_employee(self.staff_token,national_id='22222222222222',full_name='test2') - - url='/accounts/employee/{}/'.format(employee['id']) + def test_delete_doctor(self): + url='/accounts/doctor/{}/'.format(self.doctor['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - self.assertEqual(Employee.objects.count(), 0) - self.assertEqual(len( Employee.deleted_objects.all()), 1) - def test_delete_employee_hard(self): - employee, employee_token = self.create_employee(self.staff_token,national_id='22222222222223',full_name='test2') - self.assertEqual(Employee.objects.count(), 1) - url='/accounts/employee/{}/?method=hard'.format(employee['id']) + self.assertEqual(Doctor.objects.count(), 0) + self.assertEqual(len( Doctor.deleted_objects.all()), 1) + def test_delete_doctor_hard(self): + self.assertEqual(Doctor.objects.count(), 1) + url='/accounts/doctor/{}/?method=hard'.format(self.doctor['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) - + self.assertEqual(response.status_code, 204) - self.assertEqual(Employee.objects.count(), 0) - self.assertEqual(len( Employee.deleted_objects.all()), 0) - def test_delete_employee_restore(self): - employee, employee_token = self.create_employee(self.staff_token,national_id='22222222222224',full_name='test2') - - url='/accounts/employee/{}/'.format(employee['id']) + self.assertEqual(Doctor.objects.count(), 0) + self.assertEqual(len( Doctor.deleted_objects.all()), 0) + def test_delete_doctor_restore(self): + self.assertEqual(Doctor.objects.count(), 1) + url='/accounts/doctor/{}/'.format(self.doctor['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - - data={ - 'id':employee['id'] - } - url=reverse('employee-restore') + url=reverse('doctor-restore',kwargs={'pk':self.doctor['id']}) response = self.client.post( - url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token,data=data) - - self.assertEqual(response.status_code, 200) - self.assertEqual(Employee.objects.count(), 1) - self.assertEqual(len( Employee.deleted_objects.all()), 0) - def test_delete_employee_get_deleted(self): - employee, employee_token = self.create_employee(self.staff_token,national_id='22222222222225',full_name='test2') + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) - url='/accounts/employee/{}/'.format(employee['id']) + self.assertEqual(response.status_code, 200) + self.assertEqual(Doctor.objects.count(), 1) + self.assertEqual(len( Doctor.deleted_objects.all()), 0) + def test_delete_hard_after_soft(self): + self.assertEqual(Doctor.objects.count(), 1) + url='/accounts/doctor/{}/?method=soft'.format(self.doctor['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - - url=reverse('employee-get-deleted') + url=reverse('deleted-doctor-delete',kwargs={'pk':self.doctor['id']}) + response = self.client.delete( + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + self.assertEqual(response.status_code, 204) + self.assertEqual(Doctor.objects.count(), 0) + self.assertEqual(len( Doctor.deleted_objects.all()), 0) + def test_delete_doctor_get_deleted(self): + self.assertEqual(Doctor.objects.count(), 1) + url='/accounts/doctor/{}/'.format(self.doctor['id']) + response = self.client.delete( + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + self.assertEqual(response.status_code, 204) + url=reverse('doctor-get-deleted') response = self.client.get( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 200) # print(response.data) self.assertEqual(len(response.data['results']), 1) - - -class DoctorDeleteTestCase(TestSetup): +class EmployeeDeleteTestCase(TestSetup): def setUp(self) -> None: super().setUp() self.staff, self.staff_token = self.create_staff() + self.employee, self.employee_token = self.create_employee(self.staff_token) - - def test_delete_doctor(self): - doctor, doctor_token = self.create_doctor(self.staff_token,national_id='22222222222222',full_name='test2') - - url='/accounts/doctor/{}/'.format(doctor['id']) + def test_delete_employee(self): + url='/accounts/employee/{}/'.format(self.employee['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - self.assertEqual(Doctor.objects.count(), 0) - self.assertEqual(len( Doctor.deleted_objects.all()), 1) - def test_delete_doctor_hard(self): - doctor, doctor_token = self.create_doctor(self.staff_token,national_id='22222222222223',full_name='test2') - self.assertEqual(Doctor.objects.count(), 1) - url='/accounts/doctor/{}/?method=hard'.format(doctor['id']) + self.assertEqual(Employee.objects.count(), 0) + self.assertEqual(len( Employee.deleted_objects.all()), 1) + + def test_delete_employee_hard(self): + self.assertEqual(Employee.objects.count(), 1) + url='/accounts/employee/{}/?method=hard'.format(self.employee['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) - + self.assertEqual(response.status_code, 204) - self.assertEqual(Doctor.objects.count(), 0) - self.assertEqual(len( Doctor.deleted_objects.all()), 0) - def test_delete_doctor_restore(self): - doctor, doctor_token = self.create_doctor(self.staff_token,national_id='22222222222224',full_name='test2') - - url='/accounts/doctor/{}/'.format(doctor['id']) + self.assertEqual(Employee.objects.count(), 0) + self.assertEqual(len( Employee.deleted_objects.all()), 0) + + def test_delete_employee_restore(self): + self.assertEqual(Employee.objects.count(), 1) + url='/accounts/employee/{}/'.format(self.employee['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - - data={ - 'id':doctor['id'] - } - url=reverse('doctor-restore') + url=reverse('employee-restore',kwargs={'pk':self.employee['id']}) response = self.client.post( - url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token,data=data) - # print(response.data) + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + self.assertEqual(response.status_code, 200) - self.assertEqual(Doctor.objects.count(), 1) - self.assertEqual(len( Doctor.deleted_objects.all()), 0) - def test_delete_doctor_get_deleted(self): - doctor, doctor_token = self.create_doctor(self.staff_token,national_id='22222222222225',full_name='test2') - url='/accounts/doctor/{}/'.format(doctor['id']) + self.assertEqual(Employee.objects.count(), 1) + self.assertEqual(len( Employee.deleted_objects.all()), 0) + def test_delete_hard_after_soft(self): + self.assertEqual(Employee.objects.count(), 1) + url='/accounts/employee/{}/?method=soft'.format(self.employee['id']) response = self.client.delete( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - - url=reverse('doctor-get-deleted') + url=reverse('deleted-employee-delete',kwargs={'pk':self.employee['id']}) + response = self.client.delete( + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + self.assertEqual(response.status_code, 204) + self.assertEqual(Employee.objects.count(), 0) + self.assertEqual(len( Employee.deleted_objects.all()), 0) + def test_delete_employee_get_deleted(self): + self.assertEqual(Employee.objects.count(), 1) + url='/accounts/employee/{}/'.format(self.employee['id']) + response = self.client.delete( + url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + self.assertEqual(response.status_code, 204) + url=reverse('employee-get-deleted') response = self.client.get( url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 200) # print(response.data) - self.assertEqual(len(response.data['results']), 1) \ No newline at end of file + self.assertEqual(len(response.data['results']), 1) \ No newline at end of file diff --git a/project/accounts/tests/test_doctor.py b/project/accounts/tests/test_doctor.py index e69de29..ad85a7f 100644 --- a/project/accounts/tests/test_doctor.py +++ b/project/accounts/tests/test_doctor.py @@ -0,0 +1,54 @@ +from accounts.tests.test_setup import * +from accounts.models import * + + + +from django.test import TestCase, override_settings +from io import BytesIO +from PIL import Image +import os +from accounts.tests.test_setup import * +from accounts.models import * +from unittest.mock import patch +from django.core.files.uploadedfile import SimpleUploadedFile + + +class DoctorTest(TestSetup): + def setUp(self) -> None: + super().setUp() + self.staff, self.staff_token = self.create_staff() + self.patient, self.patient_token = self.create_patient( + self.staff_token,national_id="123456789000") + # self.doctor,self.doctor_token=self.create_doctor(self.staff_token) + def test_create_patient(self): + data = { + + 'marital_status': 'test', + 'nationality': 'test', + 'full_name': 'test', + 'national_id': '123456789000', + 'date_of_birth': '2000-01-01', + 'gender': 'M', + 'disease_type': 'test', + 'blood_type': 'test', + 'address': { + 'street': 'test', + 'city': 'test', + 'governorate': 'test' + }, + 'phone': { + 'mobile': 'test' + } + + + + } + + # self.client.credentials(HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + # response = self.client.post('/accounts/patient/', data, + # format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + # self.assertEqual(response.status_code, 201) + # response = self.client.post('/accounts/patient/', data, + # format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + # self.assertEqual(response.status_code, 400) + diff --git a/project/accounts/urls.py b/project/accounts/urls.py index 08b2eb1..db40067 100644 --- a/project/accounts/urls.py +++ b/project/accounts/urls.py @@ -20,7 +20,6 @@ # from django.contrib.auth.views import LoginView, LogoutView urlpatterns = [ - path('', include(router.urls)), path('token/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'), path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('token/verify/', TokenVerifyView.as_view(), name='token_verify'), @@ -29,12 +28,18 @@ path('change-password/', ChangePasswordView.as_view(), name='change-password'), - path('patients/deleted/', PatientViewSet.as_view({'get': 'get_deleted'}), name='patient-get-deleted'), - path('doctors/deleted/', DoctorViewSet.as_view({'get': 'get_deleted'}), name='doctor-get-deleted'), - path('employees/deleted/', EmployeeViewSet.as_view({'get': 'get_deleted'}), name='employee-get-deleted'), + path('patient/deleted/', PatientViewSet.as_view({'get': 'get_deleted'}), name='patient-get-deleted'), + path('doctor/deleted/', DoctorViewSet.as_view({'get': 'get_deleted'}), name='doctor-get-deleted'), + path('employee/deleted/', EmployeeViewSet.as_view({'get': 'get_deleted'}), name='employee-get-deleted'), + + path('deleted-patient/restore//', DeletedPatientView.as_view({'post': 'restore'}), name='patient-restore'), + path('deleted-patient/delete//', DeletedPatientView.as_view({'delete': 'destroy'}), name='deleted-patient-delete'), - path('employees/restore/', RestoreEmployeeView.as_view(), name='employee-restore'), - path('patients/restore/', RestorePatientView.as_view(), name='patient-restore'), - path('doctors/restore/', RestoreDoctorView.as_view(), name='doctor-restore'), + path('deleted-doctor/restore//', DeletedDoctorView.as_view({'post': 'restore'}), name='doctor-restore'), + path('deleted-doctor/delete//', DeletedDoctorView.as_view({'delete': 'destroy'}), name='deleted-doctor-delete'), + path('deleted-employee/restore//', DeletedEmployeeView.as_view({'post': 'restore'}), name='employee-restore'), + path('deleted-employee/delete//', DeletedEmployeeView.as_view({'delete': 'destroy'}), name='deleted-employee-delete'), + + path('', include(router.urls)), ] diff --git a/project/accounts/views/doctor.py b/project/accounts/views/doctor.py index ac6dfea..0ffb400 100644 --- a/project/accounts/views/doctor.py +++ b/project/accounts/views/doctor.py @@ -77,16 +77,25 @@ def get_deleted(self, request, *args, **kwargs): return paginator.get_paginated_response(serializer.data) -from rest_framework.generics import GenericAPIView -class RestoreDoctorView(GenericAPIView): + +from rest_framework import viewsets +class DeletedDoctorView(viewsets.ViewSet): serializer_class = RestoreDoctorSerializer + queryset = Doctor.deleted_objects.all() permission_classes = [IsAuthenticated,CustomPermission] - - def post(self, request, *args, **kwargs): - serializer = RestoreDoctorSerializer(data=request.data) + def restore(self, request, *args, **kwargs): + serializer = RestoreDoctorSerializer(data={'id':kwargs['pk']}) if not serializer.is_valid(): return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) instance = serializer.validated_data['id'] instance.undelete() return Response(status=status.HTTP_200_OK) + def destroy(self, request, *args, **kwargs): + serializer = RestoreDoctorSerializer(data={'id':kwargs['pk']}) + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + instance = serializer.validated_data['id'] + instance.delete(force_policy=HARD_DELETE) + return Response(status=status.HTTP_204_NO_CONTENT) \ No newline at end of file diff --git a/project/accounts/views/employee.py b/project/accounts/views/employee.py index bb8e92d..8232b70 100644 --- a/project/accounts/views/employee.py +++ b/project/accounts/views/employee.py @@ -82,16 +82,25 @@ def get_deleted(self, request, *args, **kwargs): return paginator.get_paginated_response(serializer.data) -from rest_framework.generics import GenericAPIView -class RestoreEmployeeView(GenericAPIView): + +from rest_framework import viewsets +class DeletedEmployeeView(viewsets.ViewSet): serializer_class = RestoreEmployeeSerializer + queryset = Employee.deleted_objects.all() permission_classes = [IsAuthenticated,CustomPermission] - - def post(self, request, *args, **kwargs): - serializer = RestoreEmployeeSerializer(data=request.data) + def restore(self, request, *args, **kwargs): + serializer = RestoreEmployeeSerializer(data={'id':kwargs['pk']}) if not serializer.is_valid(): return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) instance = serializer.validated_data['id'] instance.undelete() return Response(status=status.HTTP_200_OK) + def destroy(self, request, *args, **kwargs): + serializer = RestoreEmployeeSerializer(data={'id':kwargs['pk']}) + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + instance = serializer.validated_data['id'] + instance.delete(force_policy=HARD_DELETE) + return Response(status=status.HTTP_204_NO_CONTENT) \ No newline at end of file diff --git a/project/accounts/views/patient.py b/project/accounts/views/patient.py index bb27f84..a6f50e2 100644 --- a/project/accounts/views/patient.py +++ b/project/accounts/views/patient.py @@ -84,16 +84,24 @@ def get_deleted(self, request, *args, **kwargs): return paginator.get_paginated_response(serializer.data) -from rest_framework.generics import GenericAPIView -class RestorePatientView(GenericAPIView): +from rest_framework import viewsets +class DeletedPatientView(viewsets.ViewSet): serializer_class = RestorePatientSerializer - + queryset = Patient.deleted_objects.all() permission_classes = [IsAuthenticated,CustomPermission] - def post(self, request, *args, **kwargs): - serializer = RestorePatientSerializer(data=request.data) + def restore(self, request, *args, **kwargs): + serializer = RestorePatientSerializer(data={'id':kwargs['pk']}) if not serializer.is_valid(): return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) instance = serializer.validated_data['id'] instance.undelete() return Response(status=status.HTTP_200_OK) + def destroy(self, request, *args, **kwargs): + serializer = RestorePatientSerializer(data={'id':kwargs['pk']}) + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + instance = serializer.validated_data['id'] + instance.delete(force_policy=HARD_DELETE) + return Response(status=status.HTTP_204_NO_CONTENT) \ No newline at end of file diff --git a/project/visit/tests/test_delete.py b/project/visit/tests/test_delete.py index 9fb3fc5..08bf85b 100644 --- a/project/visit/tests/test_delete.py +++ b/project/visit/tests/test_delete.py @@ -37,12 +37,11 @@ def test_delete_visit_restore(self): url=f'/visit/visit/{self.visit1["id"]}/?method=soft' response = self.client.delete(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - url=reverse('visit-restore') - data={ - 'id':self.visit1['id'] - } - response = self.client.post(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token,data=data) + # url=reverse('visit-restore',) + url=f"/visit/deleted-visit/restore/{self.visit1['id']}/" + response = self.client.post(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) + print(response) self.assertEqual(response.status_code, 200) self.assertEqual(Visit.objects.count(), 2) self.assertEqual(Visit.deleted_objects.count(), 0) @@ -50,11 +49,13 @@ def test_delete_visit_get_deleted(self): url=f'/visit/visit/{self.visit1["id"]}/?method=soft' response = self.client.delete(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 204) - url=f'/visit/visits/deleted/' + url=f'/visit/visit/deleted/' response = self.client.get(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data['results']), 1) + + # class AttachmentTestCase(TestSetup): # def setUp(self) -> None: # super().setUp() diff --git a/project/visit/urls.py b/project/visit/urls.py index 5fac5ca..679dba3 100644 --- a/project/visit/urls.py +++ b/project/visit/urls.py @@ -12,7 +12,6 @@ # from django.contrib.auth.views import LoginView, LogoutView urlpatterns = [ - path('', include(router.urls)), path('statistics/', Statistics.as_view({'get': 'get'}), name='dashboard'), @@ -20,12 +19,13 @@ - # path('patients/restore/', PatientViewSet.as_view({'post': 'restore'}), name='patient-restore'), - # path('patients/deleted/', PatientViewSet.as_view({'get': 'get_deleted'}), name='patient-get-deleted'), + path('deleted-visit/restore//', DeletedVisitView.as_view({'post':'restore'}), name='visit-restore'), + path('visit/deleted/', VisitViewSet.as_view({'get': 'get_deleted'}), name='visit-get-deleted'), + path('deleted-visit/delete//', DeletedVisitView.as_view({'delete':'destroy'}), name='visit-restore'), - path('visits/deleted/', VisitViewSet.as_view({'get': 'get_deleted'}), name='visit-get-deleted'), + path('attachment/deleted/', AttachmentViewSet.as_view({'get': 'get_deleted'}), name='attachment-get-deleted'), + path('deleted-attachment/delete//', DeletedAttachmentView.as_view({'delete':'destroy'}), name='attachment-restore'), - path('attachments/deleted/', AttachmentViewSet.as_view({'get': 'get_deleted'}), name='attachment-get-deleted'), - path('visits/restore/', RestoreVisitView.as_view(), name='visit-restore'), - path('attachments/restore/', RestoreAttachmentView.as_view(), name='attachment-restore'), + path('deleted-attachment/restore//', DeletedAttachmentView.as_view({'post':'restore'}), name='attachment-restore'), + path('', include(router.urls)), ] diff --git a/project/visit/views/attachment.py b/project/visit/views/attachment.py index 8586cb5..2f1bc78 100644 --- a/project/visit/views/attachment.py +++ b/project/visit/views/attachment.py @@ -64,18 +64,6 @@ def get_deleted(self, request, *args, **kwargs): result_page = paginator.paginate_queryset( deleted_attachments, request) serializer = self.get_serializer(result_page, many=True) return paginator.get_paginated_response(serializer.data) -from rest_framework.generics import GenericAPIView -class RestoreAttachmentView(GenericAPIView): - serializer_class=RestoreAttachmentSerializer - pagination_class = CustomPagination - def post(self, request, *args, **kwargs): - serializer = RestoreAttachmentSerializer(data=request.data) - if not serializer.is_valid(): - return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) - - instance = serializer.validated_data['id'] - instance.undelete() - return Response(status=status.HTTP_200_OK) @@ -83,22 +71,24 @@ def post(self, request, *args, **kwargs): -class Statistics(GenericViewSet): - serializer_class=StatisticsSerializer - filter_backends = [ - DjangoFilterBackend, - - ] - filterset_class = StatisticsFilter - - def get(self, request, *args, **kwargs): - - - data = { - 'total_visits': Visit.objects.count(), - 'total_patients': Patient.objects.count(), - 'total_doctors': Doctor.objects.count(), - 'total_employees': Employee.objects.count(), - } - - return Response(data) +from rest_framework import viewsets +class DeletedAttachmentView(viewsets.ViewSet): + serializer_class = RestoreAttachmentSerializer + queryset = Attachment.deleted_objects.all() + permission_classes = [IsAuthenticated,CustomPermission] + def restore(self, request, *args, **kwargs): + serializer = RestoreAttachmentSerializer(data={'id':kwargs['pk']}) + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + instance = serializer.validated_data['id'] + instance.undelete() + return Response(status=status.HTTP_200_OK) + def destroy(self, request, *args, **kwargs): + serializer = RestoreAttachmentSerializer(data={'id':kwargs['pk']}) + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + instance = serializer.validated_data['id'] + instance.delete(force_policy=HARD_DELETE) + return Response(status=status.HTTP_204_NO_CONTENT) \ No newline at end of file diff --git a/project/visit/views/visit.py b/project/visit/views/visit.py index 8ee23b0..8539833 100644 --- a/project/visit/views/visit.py +++ b/project/visit/views/visit.py @@ -65,21 +65,33 @@ def get_deleted(self, request, *args, **kwargs): result_page = paginator.paginate_queryset(deleted_visits, request) serializer = self.get_serializer(result_page, many=True) return paginator.get_paginated_response(serializer.data) -from rest_framework.generics import GenericAPIView -class RestoreVisitView(GenericAPIView): - serializer_class=RestoreVisitSerializer - pagination_class = CustomPagination - def post(self, request, *args, **kwargs): - serializer = RestoreVisitSerializer(data=request.data) + + + + + + +from rest_framework import viewsets +class DeletedVisitView(viewsets.ViewSet): + serializer_class = RestoreVisitSerializer + queryset = Visit.deleted_objects.all() + permission_classes = [IsAuthenticated,CustomPermission] + def restore(self, request, *args, **kwargs): + serializer = RestoreVisitSerializer(data={'id':kwargs['pk']}) if not serializer.is_valid(): return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) instance = serializer.validated_data['id'] instance.undelete() return Response(status=status.HTTP_200_OK) - - - + def destroy(self, request, *args, **kwargs): + serializer = RestoreVisitSerializer(data={'id':kwargs['pk']}) + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + instance = serializer.validated_data['id'] + instance.delete(force_policy=HARD_DELETE) + return Response(status=status.HTTP_204_NO_CONTENT) From 8e57b093f8bf0f4084f860db48829e01acd93d71 Mon Sep 17 00:00:00 2001 From: MohamedHamed12 Date: Wed, 15 May 2024 07:57:03 +0300 Subject: [PATCH 2/4] use uuid --- ...r_employee_id_alter_patient_id_and_more.py | 61 +++++++++++++++++++ project/accounts/models/models.py | 14 ++++- project/accounts/models/patient.py | 9 +-- project/accounts/serializers/doctor.py | 3 +- project/accounts/serializers/employee.py | 4 +- project/accounts/serializers/patient.py | 7 +-- project/accounts/serializers/user.py | 11 +++- project/accounts/tests/test_patient.py | 4 +- project/accounts/urls.py | 12 ++-- ...0005_alter_attachment_id_alter_visit_id.py | 36 +++++++++++ project/visit/models/models.py | 3 + project/visit/serializers/attachment.py | 2 +- project/visit/serializers/visit.py | 2 +- project/visit/urls.py | 8 +-- 14 files changed, 143 insertions(+), 33 deletions(-) create mode 100644 project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py create mode 100644 project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py diff --git a/project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py b/project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py new file mode 100644 index 0000000..ceb56c7 --- /dev/null +++ b/project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py @@ -0,0 +1,61 @@ +# Generated by Django 5.0.3 on 2024-05-15 04:49 + +import uuid +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "accounts", + "0005_remove_doctor_is_deleted_remove_employee_is_deleted_and_more", + ), + ] + + operations = [ + migrations.AlterField( + model_name="doctor", + name="id", + field=models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + migrations.AlterField( + model_name="employee", + name="id", + field=models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + migrations.AlterField( + model_name="patient", + name="id", + field=models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + migrations.AlterField( + model_name="userimage", + name="id", + field=models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + ] diff --git a/project/accounts/models/models.py b/project/accounts/models/models.py index c61e1c2..080e760 100644 --- a/project/accounts/models/models.py +++ b/project/accounts/models/models.py @@ -14,7 +14,7 @@ User = get_user_model() from django.contrib.auth.models import AbstractUser - +import uuid # class User(AbstractUser): # pass @@ -22,6 +22,8 @@ # class Profile(SafeDeleteModel): # _safedelete_policy =SOFT_DELETE_CASCADE class Profile(SafeDeleteModel): + id=models.UUIDField(default=uuid.uuid4, editable=False, unique=True ,primary_key=True) + _safedelete_policy =SOFT_DELETE_CASCADE user = models.OneToOneField(User, on_delete=models.CASCADE , null=True ) full_name = models.CharField(max_length=255) @@ -42,3 +44,13 @@ class Meta: +class UserImage(SafeDeleteModel): + _safedelete_policy =SOFT_DELETE_CASCADE + id=models.UUIDField(default=uuid.uuid4, editable=False, unique=True ,primary_key=True) + + image = models.ImageField(upload_to='user_images' ) + # user = models.OneToOneField(User, on_delete=models.CASCADE ,related_name='user_images' ) + user = models.OneToOneField(User, on_delete=models.CASCADE ,related_name='image' ) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + is_deleted = models.BooleanField(default=False) diff --git a/project/accounts/models/patient.py b/project/accounts/models/patient.py index c906bfa..e6fb91a 100644 --- a/project/accounts/models/patient.py +++ b/project/accounts/models/patient.py @@ -1,14 +1,7 @@ from .models import * from safedelete.models import SafeDeleteModel from safedelete.models import SOFT_DELETE_CASCADE -class UserImage(SafeDeleteModel): - _safedelete_policy =SOFT_DELETE_CASCADE - image = models.ImageField(upload_to='user_images' ) - # user = models.OneToOneField(User, on_delete=models.CASCADE ,related_name='user_images' ) - user = models.OneToOneField(User, on_delete=models.CASCADE ,related_name='image' ) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - is_deleted = models.BooleanField(default=False) + class Patient(Profile): diff --git a/project/accounts/serializers/doctor.py b/project/accounts/serializers/doctor.py index b34e3dd..c9a1dc2 100644 --- a/project/accounts/serializers/doctor.py +++ b/project/accounts/serializers/doctor.py @@ -2,6 +2,7 @@ from accounts.models import Doctor from .user import * class DoctorSerializer(serializers.ModelSerializer): + image = UserImageSerializer( read_only=True, source='user.image') phone=PhoneSerializer(required=False) address =AddressSerializer( required=False) class Meta: @@ -18,7 +19,7 @@ def validate_national_id(self,value): class RestoreDoctorSerializer(serializers.Serializer): - id = serializers.IntegerField() + id = serializers.CharField() def validate_id(self, value): try: doctor=Doctor.deleted_objects.get(id=value) diff --git a/project/accounts/serializers/employee.py b/project/accounts/serializers/employee.py index d11f72f..ffcb802 100644 --- a/project/accounts/serializers/employee.py +++ b/project/accounts/serializers/employee.py @@ -2,6 +2,8 @@ from accounts.models import Employee from .user import * class EmployeeSerializer(serializers.ModelSerializer): + image = UserImageSerializer( read_only=True, source='user.image') + phone=PhoneSerializer(required=False) address =AddressSerializer( required=False) class Meta: @@ -16,7 +18,7 @@ def validate_national_id(self,value): class RestoreEmployeeSerializer(serializers.Serializer): - id = serializers.IntegerField() + id = serializers.CharField() def validate_id(self, value): try: employee=Employee.deleted_objects.get(id=value) diff --git a/project/accounts/serializers/patient.py b/project/accounts/serializers/patient.py index 54f14eb..4e4a805 100644 --- a/project/accounts/serializers/patient.py +++ b/project/accounts/serializers/patient.py @@ -3,11 +3,6 @@ from accounts.models import * from .user import * -class UserImageSerializer(serializers.ModelSerializer): - class Meta: - model = UserImage - fields = '__all__' - class PatientSerializer(serializers.ModelSerializer): @@ -38,7 +33,7 @@ def validate_national_id(self,value): class RestorePatientSerializer(serializers.Serializer): - id = serializers.IntegerField() + id = serializers.CharField() def validate_id(self, value): try: patient = Patient.deleted_objects.get(id=value) diff --git a/project/accounts/serializers/user.py b/project/accounts/serializers/user.py index defe26d..8ca3ed2 100644 --- a/project/accounts/serializers/user.py +++ b/project/accounts/serializers/user.py @@ -2,7 +2,7 @@ from django.contrib.auth.models import Group from django.contrib.auth.models import Permission from django.contrib.auth.models import User - +from accounts.models import * class PhoneSerializer(serializers.Serializer): mobile=serializers.CharField(required=False) @@ -59,4 +59,11 @@ def save(self, **kwargs): user = self.validated_data['user_id'] user.set_password(self.validated_data['new_password']) - user.save() \ No newline at end of file + user.save() + + +class UserImageSerializer(serializers.ModelSerializer): + class Meta: + model = UserImage + fields = '__all__' + diff --git a/project/accounts/tests/test_patient.py b/project/accounts/tests/test_patient.py index fb99523..1b310c2 100644 --- a/project/accounts/tests/test_patient.py +++ b/project/accounts/tests/test_patient.py @@ -65,7 +65,7 @@ def test_update_patient(self): 'marital_status': 'test', 'nationality': 'test', 'full_name': 'test2', - 'national_id': '01234567890123', + # 'national_id': '01234567890123', 'date_of_birth': '2000-01-01', 'gender': 'M', 'disease_type': 'test', @@ -254,7 +254,7 @@ def test_update_patient(self): 'marital_status': 'test', 'nationality': 'test', 'full_name': 'test2', - 'national_id': '01234567890123', + # 'national_id': '01234567890123', 'date_of_birth': '2000-01-01', 'gender': 'M', 'disease_type': 'test', diff --git a/project/accounts/urls.py b/project/accounts/urls.py index db40067..9535351 100644 --- a/project/accounts/urls.py +++ b/project/accounts/urls.py @@ -32,14 +32,14 @@ path('doctor/deleted/', DoctorViewSet.as_view({'get': 'get_deleted'}), name='doctor-get-deleted'), path('employee/deleted/', EmployeeViewSet.as_view({'get': 'get_deleted'}), name='employee-get-deleted'), - path('deleted-patient/restore//', DeletedPatientView.as_view({'post': 'restore'}), name='patient-restore'), - path('deleted-patient/delete//', DeletedPatientView.as_view({'delete': 'destroy'}), name='deleted-patient-delete'), + path('deleted-patient/restore//', DeletedPatientView.as_view({'post': 'restore'}), name='patient-restore'), + path('deleted-patient/delete//', DeletedPatientView.as_view({'delete': 'destroy'}), name='deleted-patient-delete'), - path('deleted-doctor/restore//', DeletedDoctorView.as_view({'post': 'restore'}), name='doctor-restore'), - path('deleted-doctor/delete//', DeletedDoctorView.as_view({'delete': 'destroy'}), name='deleted-doctor-delete'), + path('deleted-doctor/restore//', DeletedDoctorView.as_view({'post': 'restore'}), name='doctor-restore'), + path('deleted-doctor/delete//', DeletedDoctorView.as_view({'delete': 'destroy'}), name='deleted-doctor-delete'), - path('deleted-employee/restore//', DeletedEmployeeView.as_view({'post': 'restore'}), name='employee-restore'), - path('deleted-employee/delete//', DeletedEmployeeView.as_view({'delete': 'destroy'}), name='deleted-employee-delete'), + path('deleted-employee/restore//', DeletedEmployeeView.as_view({'post': 'restore'}), name='employee-restore'), + path('deleted-employee/delete//', DeletedEmployeeView.as_view({'delete': 'destroy'}), name='deleted-employee-delete'), path('', include(router.urls)), ] diff --git a/project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py b/project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py new file mode 100644 index 0000000..09516c3 --- /dev/null +++ b/project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py @@ -0,0 +1,36 @@ +# Generated by Django 5.0.3 on 2024-05-15 04:49 + +import uuid +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("visit", "0004_remove_attachment_is_deleted_remove_visit_is_deleted"), + ] + + operations = [ + migrations.AlterField( + model_name="attachment", + name="id", + field=models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + migrations.AlterField( + model_name="visit", + name="id", + field=models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + ] diff --git a/project/visit/models/models.py b/project/visit/models/models.py index b882954..e8354a3 100644 --- a/project/visit/models/models.py +++ b/project/visit/models/models.py @@ -6,7 +6,9 @@ from safedelete.models import SafeDeleteModel from safedelete.models import SOFT_DELETE_CASCADE +import uuid class Visit(SafeDeleteModel): + id=models.UUIDField(default=uuid.uuid4, editable=False, unique=True ,primary_key=True) _safedelete_policy =SOFT_DELETE_CASCADE @@ -29,6 +31,7 @@ def save(self, *args, **kwargs): class Attachment(SafeDeleteModel): + id=models.UUIDField(default=uuid.uuid4, editable=False, unique=True ,primary_key=True) _safedelete_policy =SOFT_DELETE_CASCADE user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_attachments', null=True, blank=True) diff --git a/project/visit/serializers/attachment.py b/project/visit/serializers/attachment.py index cda2dd4..3954d30 100644 --- a/project/visit/serializers/attachment.py +++ b/project/visit/serializers/attachment.py @@ -11,7 +11,7 @@ class Meta: fields = '__all__' class RestoreAttachmentSerializer(serializers.Serializer): - id = serializers.IntegerField() + id = serializers.CharField() def validate_id(self, value): try: attachment = Attachment.deleted_objects.get(id=value) diff --git a/project/visit/serializers/visit.py b/project/visit/serializers/visit.py index 29f4ff4..826121c 100644 --- a/project/visit/serializers/visit.py +++ b/project/visit/serializers/visit.py @@ -32,7 +32,7 @@ class Meta: class RestoreVisitSerializer(serializers.Serializer): - id = serializers.IntegerField() + id = serializers.CharField() def validate_id(self, value): try: visit = Visit.deleted_objects.get(id=value) diff --git a/project/visit/urls.py b/project/visit/urls.py index 679dba3..fa394e6 100644 --- a/project/visit/urls.py +++ b/project/visit/urls.py @@ -19,13 +19,13 @@ - path('deleted-visit/restore//', DeletedVisitView.as_view({'post':'restore'}), name='visit-restore'), + path('deleted-visit/restore//', DeletedVisitView.as_view({'post':'restore'}), name='visit-restore'), path('visit/deleted/', VisitViewSet.as_view({'get': 'get_deleted'}), name='visit-get-deleted'), - path('deleted-visit/delete//', DeletedVisitView.as_view({'delete':'destroy'}), name='visit-restore'), + path('deleted-visit/delete//', DeletedVisitView.as_view({'delete':'destroy'}), name='visit-restore'), path('attachment/deleted/', AttachmentViewSet.as_view({'get': 'get_deleted'}), name='attachment-get-deleted'), - path('deleted-attachment/delete//', DeletedAttachmentView.as_view({'delete':'destroy'}), name='attachment-restore'), + path('deleted-attachment/delete//', DeletedAttachmentView.as_view({'delete':'destroy'}), name='attachment-restore'), - path('deleted-attachment/restore//', DeletedAttachmentView.as_view({'post':'restore'}), name='attachment-restore'), + path('deleted-attachment/restore//', DeletedAttachmentView.as_view({'post':'restore'}), name='attachment-restore'), path('', include(router.urls)), ] From e5b0b45eda0c6b7537d85237313ddbb04b49e714 Mon Sep 17 00:00:00 2001 From: MohamedHamed12 Date: Wed, 15 May 2024 08:24:05 +0300 Subject: [PATCH 3/4] use uuid --- project/accounts/migrations/0001_initial.py | 69 ++++++--- project/accounts/migrations/0002_user.py | 131 ------------------ .../accounts/migrations/0003_delete_user.py | 16 --- ...eted_doctor_deleted_by_cascade_and_more.py | 53 ------- ...ted_remove_employee_is_deleted_and_more.py | 25 ---- ...r_employee_id_alter_patient_id_and_more.py | 61 -------- project/visit/migrations/0001_initial.py | 61 ++++++-- ...me_visit_end_at_visit_start_at_and_more.py | 48 ------- ..._attachment_deleted_by_cascade_and_more.py | 33 ----- ...ment_is_deleted_remove_visit_is_deleted.py | 21 --- ...0005_alter_attachment_id_alter_visit_id.py | 36 ----- 11 files changed, 106 insertions(+), 448 deletions(-) delete mode 100644 project/accounts/migrations/0002_user.py delete mode 100644 project/accounts/migrations/0003_delete_user.py delete mode 100644 project/accounts/migrations/0004_doctor_deleted_doctor_deleted_by_cascade_and_more.py delete mode 100644 project/accounts/migrations/0005_remove_doctor_is_deleted_remove_employee_is_deleted_and_more.py delete mode 100644 project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py delete mode 100644 project/visit/migrations/0002_remove_visit_datatime_visit_end_at_visit_start_at_and_more.py delete mode 100644 project/visit/migrations/0003_attachment_deleted_attachment_deleted_by_cascade_and_more.py delete mode 100644 project/visit/migrations/0004_remove_attachment_is_deleted_remove_visit_is_deleted.py delete mode 100644 project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py diff --git a/project/accounts/migrations/0001_initial.py b/project/accounts/migrations/0001_initial.py index eda1d81..744416e 100644 --- a/project/accounts/migrations/0001_initial.py +++ b/project/accounts/migrations/0001_initial.py @@ -1,6 +1,7 @@ -# Generated by Django 5.0.3 on 2024-05-11 19:37 +# Generated by Django 5.0.3 on 2024-05-15 05:22 import django.db.models.deletion +import uuid from django.conf import settings from django.db import migrations, models @@ -17,13 +18,22 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Doctor", fields=[ + ( + "deleted", + models.DateTimeField(db_index=True, editable=False, null=True), + ), + ( + "deleted_by_cascade", + models.BooleanField(default=False, editable=False), + ), ( "id", - models.BigAutoField( - auto_created=True, + models.UUIDField( + default=uuid.uuid4, + editable=False, primary_key=True, serialize=False, - verbose_name="ID", + unique=True, ), ), ("full_name", models.CharField(max_length=255)), @@ -39,7 +49,6 @@ class Migration(migrations.Migration): ("notes", models.TextField(blank=True, null=True)), ("address", models.JSONField(blank=True, null=True)), ("phone", models.JSONField(blank=True, null=True)), - ("is_deleted", models.BooleanField(default=False)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("speciality", models.CharField(max_length=255)), @@ -68,13 +77,22 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Employee", fields=[ + ( + "deleted", + models.DateTimeField(db_index=True, editable=False, null=True), + ), + ( + "deleted_by_cascade", + models.BooleanField(default=False, editable=False), + ), ( "id", - models.BigAutoField( - auto_created=True, + models.UUIDField( + default=uuid.uuid4, + editable=False, primary_key=True, serialize=False, - verbose_name="ID", + unique=True, ), ), ("full_name", models.CharField(max_length=255)), @@ -90,7 +108,6 @@ class Migration(migrations.Migration): ("notes", models.TextField(blank=True, null=True)), ("address", models.JSONField(blank=True, null=True)), ("phone", models.JSONField(blank=True, null=True)), - ("is_deleted", models.BooleanField(default=False)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( @@ -109,13 +126,22 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Patient", fields=[ + ( + "deleted", + models.DateTimeField(db_index=True, editable=False, null=True), + ), + ( + "deleted_by_cascade", + models.BooleanField(default=False, editable=False), + ), ( "id", - models.BigAutoField( - auto_created=True, + models.UUIDField( + default=uuid.uuid4, + editable=False, primary_key=True, serialize=False, - verbose_name="ID", + unique=True, ), ), ("full_name", models.CharField(max_length=255)), @@ -131,7 +157,6 @@ class Migration(migrations.Migration): ("notes", models.TextField(blank=True, null=True)), ("address", models.JSONField(blank=True, null=True)), ("phone", models.JSONField(blank=True, null=True)), - ("is_deleted", models.BooleanField(default=False)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( @@ -155,13 +180,22 @@ class Migration(migrations.Migration): migrations.CreateModel( name="UserImage", fields=[ + ( + "deleted", + models.DateTimeField(db_index=True, editable=False, null=True), + ), + ( + "deleted_by_cascade", + models.BooleanField(default=False, editable=False), + ), ( "id", - models.BigAutoField( - auto_created=True, + models.UUIDField( + default=uuid.uuid4, + editable=False, primary_key=True, serialize=False, - verbose_name="ID", + unique=True, ), ), ("image", models.ImageField(upload_to="user_images")), @@ -177,5 +211,8 @@ class Migration(migrations.Migration): ), ), ], + options={ + "abstract": False, + }, ), ] diff --git a/project/accounts/migrations/0002_user.py b/project/accounts/migrations/0002_user.py deleted file mode 100644 index d60f8aa..0000000 --- a/project/accounts/migrations/0002_user.py +++ /dev/null @@ -1,131 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-13 11:10 - -import django.contrib.auth.models -import django.contrib.auth.validators -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("accounts", "0001_initial"), - ("auth", "0012_alter_user_first_name_max_length"), - ] - - operations = [ - migrations.CreateModel( - name="User", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("password", models.CharField(max_length=128, verbose_name="password")), - ( - "last_login", - models.DateTimeField( - blank=True, null=True, verbose_name="last login" - ), - ), - ( - "is_superuser", - models.BooleanField( - default=False, - help_text="Designates that this user has all permissions without explicitly assigning them.", - verbose_name="superuser status", - ), - ), - ( - "username", - models.CharField( - error_messages={ - "unique": "A user with that username already exists." - }, - help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.", - max_length=150, - unique=True, - validators=[ - django.contrib.auth.validators.UnicodeUsernameValidator() - ], - verbose_name="username", - ), - ), - ( - "first_name", - models.CharField( - blank=True, max_length=150, verbose_name="first name" - ), - ), - ( - "last_name", - models.CharField( - blank=True, max_length=150, verbose_name="last name" - ), - ), - ( - "email", - models.EmailField( - blank=True, max_length=254, verbose_name="email address" - ), - ), - ( - "is_staff", - models.BooleanField( - default=False, - help_text="Designates whether the user can log into this admin site.", - verbose_name="staff status", - ), - ), - ( - "is_active", - models.BooleanField( - default=True, - help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.", - verbose_name="active", - ), - ), - ( - "date_joined", - models.DateTimeField( - default=django.utils.timezone.now, verbose_name="date joined" - ), - ), - ( - "groups", - models.ManyToManyField( - blank=True, - help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.", - related_name="user_set", - related_query_name="user", - to="auth.group", - verbose_name="groups", - ), - ), - ( - "user_permissions", - models.ManyToManyField( - blank=True, - help_text="Specific permissions for this user.", - related_name="user_set", - related_query_name="user", - to="auth.permission", - verbose_name="user permissions", - ), - ), - ], - options={ - "verbose_name": "user", - "verbose_name_plural": "users", - "abstract": False, - }, - managers=[ - ("objects", django.contrib.auth.models.UserManager()), - ], - ), - ] diff --git a/project/accounts/migrations/0003_delete_user.py b/project/accounts/migrations/0003_delete_user.py deleted file mode 100644 index 33a2cf1..0000000 --- a/project/accounts/migrations/0003_delete_user.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-13 11:12 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("accounts", "0002_user"), - ] - - operations = [ - migrations.DeleteModel( - name="User", - ), - ] diff --git a/project/accounts/migrations/0004_doctor_deleted_doctor_deleted_by_cascade_and_more.py b/project/accounts/migrations/0004_doctor_deleted_doctor_deleted_by_cascade_and_more.py deleted file mode 100644 index eee893c..0000000 --- a/project/accounts/migrations/0004_doctor_deleted_doctor_deleted_by_cascade_and_more.py +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-13 11:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("accounts", "0003_delete_user"), - ] - - operations = [ - migrations.AddField( - model_name="doctor", - name="deleted", - field=models.DateTimeField(db_index=True, editable=False, null=True), - ), - migrations.AddField( - model_name="doctor", - name="deleted_by_cascade", - field=models.BooleanField(default=False, editable=False), - ), - migrations.AddField( - model_name="employee", - name="deleted", - field=models.DateTimeField(db_index=True, editable=False, null=True), - ), - migrations.AddField( - model_name="employee", - name="deleted_by_cascade", - field=models.BooleanField(default=False, editable=False), - ), - migrations.AddField( - model_name="patient", - name="deleted", - field=models.DateTimeField(db_index=True, editable=False, null=True), - ), - migrations.AddField( - model_name="patient", - name="deleted_by_cascade", - field=models.BooleanField(default=False, editable=False), - ), - migrations.AddField( - model_name="userimage", - name="deleted", - field=models.DateTimeField(db_index=True, editable=False, null=True), - ), - migrations.AddField( - model_name="userimage", - name="deleted_by_cascade", - field=models.BooleanField(default=False, editable=False), - ), - ] diff --git a/project/accounts/migrations/0005_remove_doctor_is_deleted_remove_employee_is_deleted_and_more.py b/project/accounts/migrations/0005_remove_doctor_is_deleted_remove_employee_is_deleted_and_more.py deleted file mode 100644 index d6baa55..0000000 --- a/project/accounts/migrations/0005_remove_doctor_is_deleted_remove_employee_is_deleted_and_more.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-13 17:33 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("accounts", "0004_doctor_deleted_doctor_deleted_by_cascade_and_more"), - ] - - operations = [ - migrations.RemoveField( - model_name="doctor", - name="is_deleted", - ), - migrations.RemoveField( - model_name="employee", - name="is_deleted", - ), - migrations.RemoveField( - model_name="patient", - name="is_deleted", - ), - ] diff --git a/project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py b/project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py deleted file mode 100644 index ceb56c7..0000000 --- a/project/accounts/migrations/0006_alter_doctor_id_alter_employee_id_alter_patient_id_and_more.py +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-15 04:49 - -import uuid -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ( - "accounts", - "0005_remove_doctor_is_deleted_remove_employee_is_deleted_and_more", - ), - ] - - operations = [ - migrations.AlterField( - model_name="doctor", - name="id", - field=models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - migrations.AlterField( - model_name="employee", - name="id", - field=models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - migrations.AlterField( - model_name="patient", - name="id", - field=models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - migrations.AlterField( - model_name="userimage", - name="id", - field=models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - ] diff --git a/project/visit/migrations/0001_initial.py b/project/visit/migrations/0001_initial.py index bf2b3a1..2026b84 100644 --- a/project/visit/migrations/0001_initial.py +++ b/project/visit/migrations/0001_initial.py @@ -1,6 +1,7 @@ -# Generated by Django 5.0.3 on 2024-05-11 19:37 +# Generated by Django 5.0.3 on 2024-05-15 05:22 import django.db.models.deletion +import uuid from django.conf import settings from django.db import migrations, models @@ -18,14 +19,44 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Visit", fields=[ - ("id", models.AutoField(primary_key=True, serialize=False)), + ( + "deleted", + models.DateTimeField(db_index=True, editable=False, null=True), + ), + ( + "deleted_by_cascade", + models.BooleanField(default=False, editable=False), + ), + ( + "id", + models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + ( + "status", + models.CharField( + blank=True, + choices=[ + ("pending", "Pending"), + ("done", "Done"), + ("canceled", "Canceled"), + ], + max_length=255, + null=True, + ), + ), ("visit_number", models.IntegerField(null=True)), ("ticket", models.CharField(max_length=255)), ("measurement", models.JSONField(blank=True, null=True)), - ("datatime", models.DateTimeField(auto_now_add=True)), + ("start_at", models.DateTimeField(null=True)), + ("end_at", models.DateTimeField(null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), - ("is_deleted", models.BooleanField(default=False)), ("notes", models.TextField(blank=True)), ( "doctors", @@ -44,17 +75,29 @@ class Migration(migrations.Migration): ), ), ], + options={ + "abstract": False, + }, ), migrations.CreateModel( name="Attachment", fields=[ + ( + "deleted", + models.DateTimeField(db_index=True, editable=False, null=True), + ), + ( + "deleted_by_cascade", + models.BooleanField(default=False, editable=False), + ), ( "id", - models.BigAutoField( - auto_created=True, + models.UUIDField( + default=uuid.uuid4, + editable=False, primary_key=True, serialize=False, - verbose_name="ID", + unique=True, ), ), ("kind", models.CharField(max_length=255)), @@ -64,7 +107,6 @@ class Migration(migrations.Migration): ("notes", models.TextField(blank=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), - ("is_deleted", models.BooleanField(default=False)), ( "user", models.ForeignKey( @@ -86,5 +128,8 @@ class Migration(migrations.Migration): ), ), ], + options={ + "abstract": False, + }, ), ] diff --git a/project/visit/migrations/0002_remove_visit_datatime_visit_end_at_visit_start_at_and_more.py b/project/visit/migrations/0002_remove_visit_datatime_visit_end_at_visit_start_at_and_more.py deleted file mode 100644 index cd942ed..0000000 --- a/project/visit/migrations/0002_remove_visit_datatime_visit_end_at_visit_start_at_and_more.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-12 03:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("visit", "0001_initial"), - ] - - operations = [ - migrations.RemoveField( - model_name="visit", - name="datatime", - ), - migrations.AddField( - model_name="visit", - name="end_at", - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name="visit", - name="start_at", - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name="visit", - name="status", - field=models.CharField( - blank=True, - choices=[ - ("pending", "Pending"), - ("done", "Done"), - ("canceled", "Canceled"), - ], - max_length=255, - null=True, - ), - ), - migrations.AlterField( - model_name="visit", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - ] diff --git a/project/visit/migrations/0003_attachment_deleted_attachment_deleted_by_cascade_and_more.py b/project/visit/migrations/0003_attachment_deleted_attachment_deleted_by_cascade_and_more.py deleted file mode 100644 index 43101d1..0000000 --- a/project/visit/migrations/0003_attachment_deleted_attachment_deleted_by_cascade_and_more.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-13 11:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("visit", "0002_remove_visit_datatime_visit_end_at_visit_start_at_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="attachment", - name="deleted", - field=models.DateTimeField(db_index=True, editable=False, null=True), - ), - migrations.AddField( - model_name="attachment", - name="deleted_by_cascade", - field=models.BooleanField(default=False, editable=False), - ), - migrations.AddField( - model_name="visit", - name="deleted", - field=models.DateTimeField(db_index=True, editable=False, null=True), - ), - migrations.AddField( - model_name="visit", - name="deleted_by_cascade", - field=models.BooleanField(default=False, editable=False), - ), - ] diff --git a/project/visit/migrations/0004_remove_attachment_is_deleted_remove_visit_is_deleted.py b/project/visit/migrations/0004_remove_attachment_is_deleted_remove_visit_is_deleted.py deleted file mode 100644 index 3487bf9..0000000 --- a/project/visit/migrations/0004_remove_attachment_is_deleted_remove_visit_is_deleted.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-13 17:33 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("visit", "0003_attachment_deleted_attachment_deleted_by_cascade_and_more"), - ] - - operations = [ - migrations.RemoveField( - model_name="attachment", - name="is_deleted", - ), - migrations.RemoveField( - model_name="visit", - name="is_deleted", - ), - ] diff --git a/project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py b/project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py deleted file mode 100644 index 09516c3..0000000 --- a/project/visit/migrations/0005_alter_attachment_id_alter_visit_id.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 5.0.3 on 2024-05-15 04:49 - -import uuid -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("visit", "0004_remove_attachment_is_deleted_remove_visit_is_deleted"), - ] - - operations = [ - migrations.AlterField( - model_name="attachment", - name="id", - field=models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - migrations.AlterField( - model_name="visit", - name="id", - field=models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - unique=True, - ), - ), - ] From 0d5b7b57093d6d5f9ce34e1b91110aa7c659369c Mon Sep 17 00:00:00 2001 From: MohamedHamed12 Date: Wed, 15 May 2024 08:31:12 +0300 Subject: [PATCH 4/4] fix tests --- project/project/media/user_images/example.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_07E2l0C.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_0ck20Dz.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_1id7TOz.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_4AtyFCd.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_4unDP8l.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_6mRE9YH.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_8zn8RbI.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_CCK2p9O.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_Cd2BTaw.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_DJvaTRJ.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_Glbfsif.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_GxI0Ipj.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_Hj0vxpR.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_IGrpK7h.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_KpXfq0i.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_OXCrd0X.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_OuLPRqR.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_QU6wvOv.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_QeN3ULA.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_TiFK3CA.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_UIZK5V3.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_UaAJFWJ.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_WUzTeDQ.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_X3IZ8IX.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_YWTQqPx.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_YnizZXa.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_Zlsl8cq.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_aRLxZpU.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_dSrdHj3.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_gwIifAl.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_jM5jOsT.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_kGyzMtw.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_lQV7DEV.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_p3tgstM.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_po1SGVi.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_rYQYaes.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_sdECB8D.jpg | Bin 825 -> 0 bytes .../project/media/user_images/example_zxaI2D0.jpg | Bin 825 -> 0 bytes project/visit/tests/test_filters.py | 6 +++--- 40 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 project/project/media/user_images/example.jpg delete mode 100644 project/project/media/user_images/example_07E2l0C.jpg delete mode 100644 project/project/media/user_images/example_0ck20Dz.jpg delete mode 100644 project/project/media/user_images/example_1id7TOz.jpg delete mode 100644 project/project/media/user_images/example_4AtyFCd.jpg delete mode 100644 project/project/media/user_images/example_4unDP8l.jpg delete mode 100644 project/project/media/user_images/example_6mRE9YH.jpg delete mode 100644 project/project/media/user_images/example_8zn8RbI.jpg delete mode 100644 project/project/media/user_images/example_CCK2p9O.jpg delete mode 100644 project/project/media/user_images/example_Cd2BTaw.jpg delete mode 100644 project/project/media/user_images/example_DJvaTRJ.jpg delete mode 100644 project/project/media/user_images/example_Glbfsif.jpg delete mode 100644 project/project/media/user_images/example_GxI0Ipj.jpg delete mode 100644 project/project/media/user_images/example_Hj0vxpR.jpg delete mode 100644 project/project/media/user_images/example_IGrpK7h.jpg delete mode 100644 project/project/media/user_images/example_KpXfq0i.jpg delete mode 100644 project/project/media/user_images/example_OXCrd0X.jpg delete mode 100644 project/project/media/user_images/example_OuLPRqR.jpg delete mode 100644 project/project/media/user_images/example_QU6wvOv.jpg delete mode 100644 project/project/media/user_images/example_QeN3ULA.jpg delete mode 100644 project/project/media/user_images/example_TiFK3CA.jpg delete mode 100644 project/project/media/user_images/example_UIZK5V3.jpg delete mode 100644 project/project/media/user_images/example_UaAJFWJ.jpg delete mode 100644 project/project/media/user_images/example_WUzTeDQ.jpg delete mode 100644 project/project/media/user_images/example_X3IZ8IX.jpg delete mode 100644 project/project/media/user_images/example_YWTQqPx.jpg delete mode 100644 project/project/media/user_images/example_YnizZXa.jpg delete mode 100644 project/project/media/user_images/example_Zlsl8cq.jpg delete mode 100644 project/project/media/user_images/example_aRLxZpU.jpg delete mode 100644 project/project/media/user_images/example_dSrdHj3.jpg delete mode 100644 project/project/media/user_images/example_gwIifAl.jpg delete mode 100644 project/project/media/user_images/example_jM5jOsT.jpg delete mode 100644 project/project/media/user_images/example_kGyzMtw.jpg delete mode 100644 project/project/media/user_images/example_lQV7DEV.jpg delete mode 100644 project/project/media/user_images/example_p3tgstM.jpg delete mode 100644 project/project/media/user_images/example_po1SGVi.jpg delete mode 100644 project/project/media/user_images/example_rYQYaes.jpg delete mode 100644 project/project/media/user_images/example_sdECB8D.jpg delete mode 100644 project/project/media/user_images/example_zxaI2D0.jpg diff --git a/project/project/media/user_images/example.jpg b/project/project/media/user_images/example.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_07E2l0C.jpg b/project/project/media/user_images/example_07E2l0C.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_0ck20Dz.jpg b/project/project/media/user_images/example_0ck20Dz.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_1id7TOz.jpg b/project/project/media/user_images/example_1id7TOz.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_4AtyFCd.jpg b/project/project/media/user_images/example_4AtyFCd.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_4unDP8l.jpg b/project/project/media/user_images/example_4unDP8l.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_6mRE9YH.jpg b/project/project/media/user_images/example_6mRE9YH.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_8zn8RbI.jpg b/project/project/media/user_images/example_8zn8RbI.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_CCK2p9O.jpg b/project/project/media/user_images/example_CCK2p9O.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_Cd2BTaw.jpg b/project/project/media/user_images/example_Cd2BTaw.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_DJvaTRJ.jpg b/project/project/media/user_images/example_DJvaTRJ.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_Glbfsif.jpg b/project/project/media/user_images/example_Glbfsif.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_GxI0Ipj.jpg b/project/project/media/user_images/example_GxI0Ipj.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_Hj0vxpR.jpg b/project/project/media/user_images/example_Hj0vxpR.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_IGrpK7h.jpg b/project/project/media/user_images/example_IGrpK7h.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_KpXfq0i.jpg b/project/project/media/user_images/example_KpXfq0i.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_OXCrd0X.jpg b/project/project/media/user_images/example_OXCrd0X.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_OuLPRqR.jpg b/project/project/media/user_images/example_OuLPRqR.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_QU6wvOv.jpg b/project/project/media/user_images/example_QU6wvOv.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_QeN3ULA.jpg b/project/project/media/user_images/example_QeN3ULA.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_TiFK3CA.jpg b/project/project/media/user_images/example_TiFK3CA.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_UIZK5V3.jpg b/project/project/media/user_images/example_UIZK5V3.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_UaAJFWJ.jpg b/project/project/media/user_images/example_UaAJFWJ.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_WUzTeDQ.jpg b/project/project/media/user_images/example_WUzTeDQ.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_X3IZ8IX.jpg b/project/project/media/user_images/example_X3IZ8IX.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_YWTQqPx.jpg b/project/project/media/user_images/example_YWTQqPx.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_YnizZXa.jpg b/project/project/media/user_images/example_YnizZXa.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_Zlsl8cq.jpg b/project/project/media/user_images/example_Zlsl8cq.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_aRLxZpU.jpg b/project/project/media/user_images/example_aRLxZpU.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_dSrdHj3.jpg b/project/project/media/user_images/example_dSrdHj3.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_gwIifAl.jpg b/project/project/media/user_images/example_gwIifAl.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_jM5jOsT.jpg b/project/project/media/user_images/example_jM5jOsT.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_kGyzMtw.jpg b/project/project/media/user_images/example_kGyzMtw.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_lQV7DEV.jpg b/project/project/media/user_images/example_lQV7DEV.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_p3tgstM.jpg b/project/project/media/user_images/example_p3tgstM.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_po1SGVi.jpg b/project/project/media/user_images/example_po1SGVi.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_rYQYaes.jpg b/project/project/media/user_images/example_rYQYaes.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_sdECB8D.jpg b/project/project/media/user_images/example_sdECB8D.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/project/media/user_images/example_zxaI2D0.jpg b/project/project/media/user_images/example_zxaI2D0.jpg deleted file mode 100644 index e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh diff --git a/project/visit/tests/test_filters.py b/project/visit/tests/test_filters.py index 126e944..720256d 100644 --- a/project/visit/tests/test_filters.py +++ b/project/visit/tests/test_filters.py @@ -14,20 +14,20 @@ def setUp(self) -> None: self.visit2 = self.create_visit(self.staff_token,patient=self.patient2['id'],start_at='2020-01-02') def test_get_visit(self): - url='/visit/visit/?order_by=-id' + url='/visit/visit/?order_by=created_at' response = self.client.get(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data['results']), 2) visit1=response.data['results'][0] visit2=response.data['results'][1] - self.assertEqual(visit1['id'] < visit2['id'], True) + self.assertEqual(visit1['created_at'] < visit2['created_at'], True) url='/visit/visit/?order_by=id' response = self.client.get(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data['results']), 2) visit1=response.data['results'][0] visit2=response.data['results'][1] - self.assertEqual(visit1['id'] > visit2['id'], False) + self.assertEqual(visit1['created_at'] > visit2['created_at'], False) def test_get_visit_order_by_start_at(self): url='/visit/visit/?order_by=start_at' response = self.client.get(url, format='json', HTTP_AUTHORIZATION='Bearer ' + self.staff_token)