mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
QueryParameterVersioning does not use default version
QueryParameterVersioning does not fall back to the value used in the `DEFAULT_VERSION` setting, while other versioning schemes do. This looks like a minor change, and incorporates the `self.default_version` set in the superclass. I'll sheepishly admit that I edited this inline without running any tests or anything, so please let me know if this needs more work.
This commit is contained in:
parent
2ce3ab59a6
commit
40b5774a33
|
@ -166,7 +166,7 @@ class QueryParameterVersioning(BaseVersioning):
|
|||
invalid_version_message = _('Invalid version in query parameter.')
|
||||
|
||||
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):
|
||||
raise exceptions.NotFound(self.invalid_version_message)
|
||||
return version
|
||||
|
|
Loading…
Reference in New Issue
Block a user