Skip to content

Commit

Permalink
Use Default Version in URLPathVersioning if 'version' Didn't Specifie…
Browse files Browse the repository at this point in the history
…d by Client (#6380)

* Use Default Version in URLPathVersioning if 'version' Didn't Passed

* Clean Code
  • Loading branch information
ykh authored and tomchristie committed Jan 8, 2019
1 parent 4863a24 commit 0cf18c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rest_framework/versioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class URLPathVersioning(BaseVersioning):

def determine_version(self, request, *args, **kwargs):
version = kwargs.get(self.version_param, self.default_version)
if version is None:
version = self.default_version

if not self.is_allowed_version(version):
raise exceptions.NotFound(self.invalid_version_message)
return version
Expand Down

0 comments on commit 0cf18c4

Please sign in to comment.