Skip to content

Commit

Permalink
fix: retrieve methods shows only not "deleted" objects for all models
Browse files Browse the repository at this point in the history
  • Loading branch information
avinogrado authored and the-homeless-god committed Aug 31, 2024
1 parent 4124dad commit bad610a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/backend/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def list(self, request, *args, **kwargs):
def retrieve(self, request, *args, **kwargs):
logging.info(f'{request},find - id = {kwargs["pk"]}')
try:
data = Employee.objects.filter(id = kwargs['pk'])[0]
data = Employee.objects.filter(id = kwargs['pk'],is_deleted = False)[0]
serializer = Employee_Serializer(data)
logging.info('Object found')
return Response(serializer.data,status = status.HTTP_200_OK)
Expand Down Expand Up @@ -84,7 +84,7 @@ def list(self,request,*args,**kwarfs):
def retrieve(self, request, *args, **kwargs):
logging.info(f'{request},find - id = {kwargs["pk"]}')
try:
data = Project.objects.filter(id = kwargs['pk'])[0]
data = Project.objects.filter(id = kwargs['pk'],is_deleted = False)[0]
serializer = Project_Serializer(data)
logging.info('Object found')
return Response(serializer.data,status = status.HTTP_200_OK)
Expand Down Expand Up @@ -148,7 +148,7 @@ def list(self,request,*args,**kwargs):
def retrieve(self, request, *args, **kwargs):
logging.info(f'{request},find - id = {kwargs["pk"]}')
try:
data = Report.objects.filter(id = kwargs['pk'])[0]
data = Report.objects.filter(id = kwargs['pk'],is_deleted = False)[0]
serializer = Report_Serializer(data)
logging.info('Object found')
return Response(serializer.data,status = status.HTTP_200_OK)
Expand Down Expand Up @@ -240,7 +240,7 @@ def create(self,request,*args,**kwargs):
def retrieve(self, request, *args, **kwargs):
logging.info(f'{request},find - id = {kwargs["pk"]}')
try:
data = Objective.objects.filter(id = kwargs['pk'])[0]
data = Objective.objects.filter(id = kwargs['pk'],is_deleted = False)[0]
serializer = Objective_Serializer(data)
logging.info('Object found')
return Response(serializer.data,status = status.HTTP_200_OK)
Expand Down

0 comments on commit bad610a

Please sign in to comment.