You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by va...@apache.org on 2025/03/13 18:31:47 UTC

(superset) branch fix/perm-sync-UnboundLocalError created (now 51b2f1b6f0)

This is an automated email from the ASF dual-hosted git repository.

vavila pushed a change to branch fix/perm-sync-UnboundLocalError
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 51b2f1b6f0 fix(sync perms): Avoid UnboundLocalError during perm sync for DBs that don't support catalogs

This branch includes the following new commits:

     new 51b2f1b6f0 fix(sync perms): Avoid UnboundLocalError during perm sync for DBs that don't support catalogs

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: fix(sync perms): Avoid UnboundLocalError during perm sync for DBs that don't support catalogs

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vavila pushed a commit to branch fix/perm-sync-UnboundLocalError
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 51b2f1b6f06823e93c46a9c5f4bd1b8dde1d8b34
Author: Vitor Avila <vi...@preset.io>
AuthorDate: Thu Mar 13 15:31:29 2025 -0300

    fix(sync perms): Avoid UnboundLocalError during perm sync for DBs that don't support catalogs
---
 superset/commands/database/sync_permissions.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/superset/commands/database/sync_permissions.py b/superset/commands/database/sync_permissions.py
index 3f2bf36a0e..c4213da98f 100644
--- a/superset/commands/database/sync_permissions.py
+++ b/superset/commands/database/sync_permissions.py
@@ -249,11 +249,11 @@ class SyncPermissionsCommand(BaseCommand):
         self, catalog: str | None, schemas: Iterable[str]
     ) -> None:
         # rename existing catalog permission
+        new_catalog_perm_name = security_manager.get_catalog_perm(
+            self.db_connection.name,
+            catalog,
+        )
         if catalog:
-            new_catalog_perm_name = security_manager.get_catalog_perm(
-                self.db_connection.name,
-                catalog,
-            )
             new_catalog_vm = add_vm(db.session, security_manager, new_catalog_perm_name)
             perm = security_manager.get_catalog_perm(
                 self.old_db_connection_name,