Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0cf18c4

Browse filesBrowse files
ykhtomchristie
authored andcommitted
Use Default Version in URLPathVersioning if 'version' Didn't Specified by Client (#6380)
* Use Default Version in URLPathVersioning if 'version' Didn't Passed * Clean Code
1 parent 4863a24 commit 0cf18c4
Copy full SHA for 0cf18c4

File tree

1 file changed

+3
-0
lines changed
Filter options

1 file changed

+3
-0
lines changed

‎rest_framework/versioning.py

Copy file name to clipboardExpand all lines: rest_framework/versioning.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class URLPathVersioning(BaseVersioning):
7575

7676
def determine_version(self, request, *args, **kwargs):
7777
version = kwargs.get(self.version_param, self.default_version)
78+
if version is None:
79+
version = self.default_version
80+
7881
if not self.is_allowed_version(version):
7982
raise exceptions.NotFound(self.invalid_version_message)
8083
return version

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.