Exemplo n.º 1
0
 def get(self, request, system_id=None):
     params = request.GET.copy()
     if request.user.is_authenticated:
         ag = request.user.agave_oauth.client
         if system_id is None:
             systems = BaseSystemResource.list(ag, **params)
             return JsonResponse(systems, encoder=AgaveJSONEncoder, safe=False)
         else:
             system = BaseSystemResource.from_id(ag, system_id)
             return JsonResponse(system, encoder=AgaveJSONEncoder, safe=False)
     else:
         # Force public=true
         params.pop('public', None)
         ag = get_service_account_client()
         systems = BaseSystemResource.list(ag, public=True, **params)
         return JsonResponse(systems, encoder=AgaveJSONEncoder, safe=False)
Exemplo n.º 2
0
 def project_system(self):
     if self._project_system is None:
         self._project_system = BaseSystemResource.from_id(
             self._agave, self.project_system_id)
     return self._project_system