Beispiel #1
0
 def dispatch(self, request, *args, **kwargs):
     if "file" not in self.request.GET:
         raise BadRequest("Expected a `file` parameter")
     return super().dispatch(request, *args, **kwargs)
Beispiel #2
0
def raises400_bad_request(request):
    raise BadRequest('Malformed request syntax')
Beispiel #3
0
 def dispatch(self, request, *args, **kwargs):
     for param in self.required_parameters:
         if param not in self.request.GET:
             raise BadRequest(f"Expected a `{param}` parameter")
     return super().dispatch(request, *args, **kwargs)
Beispiel #4
0
def bad_request(request):
    raise BadRequest()