Changeset - 2b90110871bf
[Not reviewed]
0 1 0
Lance Edgar (lance) - 3 months ago 2024-07-15 21:49:58
lance@edbob.org
fix: avoid deprecated `self.model` within the auth handler

per wuttjamaican
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rattail/auth.py
Show inline comments
 
@@ -107,7 +107,7 @@ class AuthHandler(base.AuthHandler, MergeMixin):
 
        Authenticate the given user API token string, and if valid,
 
        return the corresponding User object.
 
        """
 
        model = self.model
 
        model = self.app.model
 

	
 
        try:
 
            token = session.query(model.UserAPIToken)\
 
@@ -149,7 +149,7 @@ class AuthHandler(base.AuthHandler, MergeMixin):
 
        """
 
        Add a new API token for the user.
 
        """
 
        model = self.model
 
        model = self.app.model
 
        session = self.app.get_session(user)
 

	
 
        # generate raw API token, in the form required for use within
 
@@ -224,7 +224,7 @@ class AuthHandler(base.AuthHandler, MergeMixin):
 
    def merge_update_keeping_object(self, removing, keeping):
 
        super().merge_update_keeping_object(removing, keeping)
 
        session = self.app.get_session(keeping)
 
        model = self.model
 
        model = self.app.model
 

	
 
        # update any notes authored by old user, to reflect new user
 
        notes = session.query(model.Note)\
 
@@ -245,7 +245,7 @@ class AuthHandler(base.AuthHandler, MergeMixin):
 
           which should be purged from the versioning tables.
 
        """
 
        session = self.app.get_session(user)
 
        model = self.model
 
        model = self.app.model
 

	
 
        # remove the user from any continuum transactions
 
        # nb. we can use "any" model class here, to obtain Transaction
0 comments (0 inline, 0 general)