Skip to content

Commit

Permalink
Fix: don't use joined relationship for 'favorite' parameter (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 authored Jul 3, 2024
1 parent 8be8607 commit 4996804
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions mwdb/model/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ class Object(db.Model):
cascade="save-update, merge, delete",
)

followers = db.relationship(
"User", secondary=favorites, back_populates="favorites", lazy="joined"
)
followers = db.relationship("User", secondary=favorites, back_populates="favorites")

comment_authors = db.relationship(
"User",
Expand Down
2 changes: 1 addition & 1 deletion mwdb/model/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class User(db.Model):
back_populates="related_user",
)
favorites = db.relationship(
"Object", secondary=favorites, back_populates="followers", lazy="joined"
"Object", secondary=favorites, back_populates="followers"
)

commented_objects = db.relationship(
Expand Down

0 comments on commit 4996804

Please sign in to comment.