diff options
| -rw-r--r-- | fietsboek/models/user.py | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/fietsboek/models/user.py b/fietsboek/models/user.py index 58a04bd..e1b4841 100644 --- a/fietsboek/models/user.py +++ b/fietsboek/models/user.py @@ -141,20 +141,20 @@ class User(Base):      def factory(cls, request: Request) -> "User":          """Factory method to pass to a route definition. -        This factory retrieves the track based on the ``track_id`` matched -        route parameter, and returns the track. If the track is not found, +        This factory retrieves the user based on the ``user_id`` matched +        route parameter, and returns the user. If the user is not found,          ``HTTPNotFound`` is raised. -        :raises pyramid.httpexception.NotFound: If the track is not found. +        :raises pyramid.httpexception.NotFound: If the user is not found.          :param request: The pyramid request. -        :return: The track. +        :return: The user.          """          user_id = request.matchdict["user_id"]          query = select(cls).filter_by(id=user_id) -        track = request.dbsession.execute(query).scalar_one_or_none() -        if track is None: +        user = request.dbsession.execute(query).scalar_one_or_none() +        if user is None:              raise HTTPNotFound() -        return track +        return user      def __acl__(self):          acl = [  | 
