GitHub user user1500177 added a comment to the discussion: Upgrade to Superset 
Version 5 to 6 (Issues Faced)

@dosu or Anyone can answer

I am facing another issue now 
ISSUE 2
---

**Title:** Superset 6.0.0: AttributeError 'CustomSsoSecurityManager' object has 
no attribute 'get_session'

**Body:**

Hi community,

After upgrading to Superset 6.0.0, I’m facing an error during app startup 
related to a custom security manager. The error is:

```
AttributeError: 'CustomSsoSecurityManager' object has no attribute 'get_session'
```

This happens when trying to create or update service account users in my custom 
security manager. The relevant code looks like this:

**Before (working in Superset 5.x):**
```python
class CustomSsoSecurityManager(SupersetSecurityManager):

    def create_or_update_service_account_users(self):
        # ...existing code...
        if user:
            # ...existing code...
            user.active = True
            user.account_id = "SERVICE_ACCOUNT"
            user.businessunit_id = "SERVICE_ACCOUNT"
            user.customer_id = "SERVICE_ACCOUNT"
            user.warehouse_id = "SERVICE_ACCOUNT"
            self.get_session.commit()
            logging.info(f"Service account user '{username}' created 
successfully.")
        else:
            logging.error(f"Failed to create service account user 
'{username}'.")
        # ...existing code...
```

**After upgrading to Superset 6.0.0, I get the error above.**

Has anyone else encountered this? Is there a recommended way to handle session 
commits in custom security managers with the new version? Any guidance or 
examples would be appreciated!

Thanks in advance!

---

Let me know if you want to add more details or context.

GitHub link: 
https://github.com/apache/superset/discussions/36869#discussioncomment-15379226

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to