Skip to content
Snippets Groups Projects
Commit dff86cba authored by jaden's avatar jaden
Browse files

plotter configs now being sent if anon user, fixes #470

parent c59743d7
No related branches found
No related tags found
1 merge request!223Reports overhaul
...@@ -91,9 +91,10 @@ class ListPlotterParameterView(ListContributionView): ...@@ -91,9 +91,10 @@ class ListPlotterParameterView(ListContributionView):
dataformat__name = name, dataformat__name = name,
dataformat__version = version) dataformat__version = version)
else: else:
author_name = 'plot' if self.request.user.is_anonymous() else self.request.user.username
#return self.model.objects.all() #return self.model.objects.all()
#from author and public and get latest version only #from author and public and get latest version only
objects = self.model.objects.from_author_and_public(self.request.user, self.request.user.username).order_by('-version') objects = self.model.objects.from_author_and_public(self.request.user, author_name).order_by('-version')
filtered_list = [] filtered_list = []
filtered_list_id = [] filtered_list_id = []
for the_item in objects: for the_item in objects:
...@@ -104,7 +105,7 @@ class ListPlotterParameterView(ListContributionView): ...@@ -104,7 +105,7 @@ class ListPlotterParameterView(ListContributionView):
if check == False: if check == False:
filtered_list.append(the_item) filtered_list.append(the_item)
filtered_list_id.append(the_item.id) filtered_list_id.append(the_item.id)
objects = self.model.objects.from_author_and_public(self.request.user, self.request.user.username).order_by('-version').filter(id__in=filtered_list_id) objects = self.model.objects.from_author_and_public(self.request.user, author_name).order_by('-version').filter(id__in=filtered_list_id)
return objects return objects
class ListDefaultPlotterView(generics.ListAPIView): class ListDefaultPlotterView(generics.ListAPIView):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment