Merge pull request #3833 from bradmontgomery/patch-1

QueryParameterVersioning does not use default version
This commit is contained in:
Xavier Ordoquy 2016-01-14 20:33:05 +01:00
commit 30ef38c861

View File

@ -166,7 +166,7 @@ class QueryParameterVersioning(BaseVersioning):
invalid_version_message = _('Invalid version in query parameter.') invalid_version_message = _('Invalid version in query parameter.')
def determine_version(self, request, *args, **kwargs): def determine_version(self, request, *args, **kwargs):
version = request.query_params.get(self.version_param) version = request.query_params.get(self.version_param, self.default_version)
if not self.is_allowed_version(version): if not self.is_allowed_version(version):
raise exceptions.NotFound(self.invalid_version_message) raise exceptions.NotFound(self.invalid_version_message)
return version return version