diff --git a/tom_common/api_router.py b/tom_common/api_router.py index d958b8ee..fbeb7b68 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):