From b890b67a32e614d195998ca6ef5f0e40db352e07 Mon Sep 17 00:00:00 2001 From: Dan Avner Date: Thu, 21 Nov 2024 16:45:29 -0800 Subject: [PATCH] Bugfix: Correct basename logic in router so it is not always None. --- tom_common/api_router.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tom_common/api_router.py b/tom_common/api_router.py index d958b8ee1..fbeb7b68c 100644 --- a/tom_common/api_router.py +++ b/tom_common/api_router.py @@ -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):