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