def get_object_list(self, request): """Filter the queryset based upon the request user. """ object_list = super(AbstractVegObservationResource, self).get_object_list(request) if readonly_user(request.user): return object_list.filter(vegetation_visit__site_visit__data_status='approved') else: return object_list
def get_context_data(self, **kwargs): context = super(DashboardView, self).get_context_data(**kwargs) context['readonly_user'] = readonly_user(self.request.user) return context