vimzoomer commented on code in PR #5:
URL: 
https://github.com/apache/casbin-python-django-orm-adapter/pull/5#discussion_r2936995506


##########
casbin_adapter/enforcer.py:
##########
@@ -43,9 +43,9 @@ def _load(self):
                 self.set_role_manager(role_manager)
 
     def __getattribute__(self, name):
-        safe_methods = ["__init__", "_load", "_initialized"]
+        safe_methods = ["__init__", "_load", "_initialized", "__class__"]
         if not super().__getattribute__("_initialized") and name not in 
safe_methods:
-            initialize_enforcer(self.db_alias)
+            initialize_enforcer(super().__getattribute__("db_alias"))
             if not super().__getattribute__("_initialized"):

Review Comment:
   Testing it properly wouldn't be that easy, currently calling any method from 
`safe_methods` obviously won't trigger any errors, same with 
`super().__getattribute__("db_alias")`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to