Exemplo n.º 1
0
 def get(self, request, **kwargs):
     try:
         return Response(api.course_structure(self.course_key))
     except errors.CourseStructureNotAvailableError:
         # If we don't have data stored, we will try to regenerate it, so
         # return a 503 and as them to retry in 2 minutes.
         return Response(status=503, headers={'Retry-After': '120'})
Exemplo n.º 2
0
 def get(self, request, **kwargs):
     try:
         return Response(api.course_structure(self.course_key))
     except errors.CourseStructureNotAvailableError:
         # If we don't have data stored, we will try to regenerate it, so
         # return a 503 and as them to retry in 2 minutes.
         return Response(status=503, headers={'Retry-After': '120'})