Skip to content

Commit

Permalink
Bugfix: Correct basename logic in router so it is not always None.
Browse files Browse the repository at this point in the history
  • Loading branch information
davner committed Nov 22, 2024
1 parent 2ec4d26 commit b890b67
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 b890b67

Please sign in to comment.