Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
bradmontgomery committed Jan 14, 2016
commit 40b5774a3335ff0f186bc324758fd6e9da69c94a
2 changes: 1 addition & 1 deletion rest_framework/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down