mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
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
This commit is contained in:
parent
4863a24451
commit
0cf18c4163
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user