Changeset - 94b6dc91c541
[Not reviewed]
0 1 0
Lance Edgar (lance) - 3 months ago 2024-07-15 22:19:56
lance@edbob.org
fix: avoid deprecated `self.model` for people handler

per wuttjamaican
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
rattail/people.py
Show inline comments
 
@@ -51,7 +51,7 @@ class PeopleHandler(base.PeopleHandler, MergeMixin):
 
        the "default" person associated with the object.  Depending on
 
        how the app tracks relationships, this logic may need to vary.
 
        """
 
        model = self.model
 
        model = self.app.model
 

	
 
        if isinstance(obj, model.Person):
 
            return obj
 
@@ -97,7 +97,7 @@ class PeopleHandler(base.PeopleHandler, MergeMixin):
 
        """
 
        from sqlalchemy import orm
 

	
 
        model = self.model
 
        model = self.app.model
 
        field = self.app.get_customer_key_field()
 

	
 
        # validate/coerce data type
 
@@ -132,7 +132,7 @@ class PeopleHandler(base.PeopleHandler, MergeMixin):
 
        """
 
        Make and return a new Person instance.
 
        """
 
        model = self.model
 
        model = self.app.model
 
        person = model.Person()
 

	
 
        if 'first_name' in kwargs:
 
@@ -426,7 +426,7 @@ class PeopleHandler(base.PeopleHandler, MergeMixin):
 
        which removed, but really this is arbitrary, as the user
 
        performing the merge is free to swap them around.
 
        """
 
        model = self.model
 
        model = self.app.model
 
        session = self.app.get_session(user)
 
        merge = model.MergePeopleRequest()
 
        merge.removing_uuid = removing_uuid
 
@@ -443,7 +443,7 @@ class PeopleHandler(base.PeopleHandler, MergeMixin):
 
        Send an email alert regarding a new merge request.
 
        """
 
        session = self.app.get_session(merge)
 
        model = self.model
 
        model = self.app.model
 

	
 
        removing = session.get(model.Person, merge.removing_uuid)
 
        keeping = session.get(model.Person, merge.keeping_uuid)
 
@@ -561,7 +561,7 @@ class PeopleHandler(base.PeopleHandler, MergeMixin):
 
        import sqlalchemy as sa
 

	
 
        session = self.app.get_session(keeping)
 
        model = self.model
 
        model = self.app.model
 
        merge_requests = session.query(model.MergePeopleRequest)\
 
                                .filter(sa.or_(
 
                                    sa.and_(
0 comments (0 inline, 0 general)