Skip to content

Commit

Permalink
Merge pull request #1123 from davner/bugfix/router-basename
Browse files Browse the repository at this point in the history
Fix Basename Parsing in Router Registration Method
  • Loading branch information
jchate6 authored Dec 5, 2024
2 parents 85d5158 + f8ed294 commit 4d4ed4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tom_common/api_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SharedAPIRootRouter(SimpleRouter):
def register(self, *args, **kwargs):
logger.info(f'registering new views: args: {args}, kwargs: {kwargs}')
viewset = kwargs.get('viewset') or args[1]
basename = kwargs.get('basename') or args[2] if len(args) > 2 else None
basename = kwargs.get('basename') or (args[2] if len(args) > 2 else None)
if not basename:
basename = self.shared_router.get_default_basename(viewset)
if self.shared_router.is_already_registered(basename):
Expand Down

0 comments on commit 4d4ed4a

Please sign in to comment.