Fixed structure view
This commit is contained in:
parent
88e488e481
commit
0688c622cc
|
|
@ -41,14 +41,8 @@ class EmployeeEstablishmentsListView(generics.ListAPIView):
|
|||
|
||||
def get_queryset(self):
|
||||
pk = self.kwargs.get('pk')
|
||||
|
||||
try:
|
||||
employee = models.Employee.objects.get(pk=pk)
|
||||
|
||||
except ObjectDoesNotExist:
|
||||
raise Http404
|
||||
|
||||
return employee.establishments.all()
|
||||
employee = get_object_or_404(models.Employee, pk=pk)
|
||||
return employee.establishments.with_extended_related()
|
||||
|
||||
|
||||
class EstablishmentRUDView(generics.RetrieveUpdateDestroyAPIView):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user