예제 #1
0
파일: views.py 프로젝트: owaisj/portal
 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)
예제 #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