Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Dec 18, 2024
1 parent 795a0a8 commit aa03e05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions mwdb/model/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ class Object(db.Model):
share_3rd_party = db.Column(db.Boolean, nullable=False)

upload_count = column_property(
select([func.count(distinct(ObjectPermission.related_user_id))]).where(
select([func.count(distinct(ObjectPermission.related_user_id))])
.where(
and_(
ObjectPermission.object_id == id,
ObjectPermission.reason_type == AccessType.ADDED,
)
),
)
.scalar_subquery(),
deferred=True,
)

Expand Down Expand Up @@ -105,7 +107,7 @@ class Object(db.Model):
"User",
secondary="comment",
back_populates="commented_objects",
passive_deletes=True,
viewonly=True,
)

shares = db.relationship(
Expand Down
2 changes: 1 addition & 1 deletion mwdb/model/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class User(db.Model):
"Object",
secondary="comment",
back_populates="comment_authors",
passive_deletes=True,
viewonly=True,
)

comments = db.relationship(
Expand Down

0 comments on commit aa03e05

Please sign in to comment.