forked from rDrama/rDrama
dfg
parent
fcff49fe75
commit
0c247b1add
|
@ -34,7 +34,7 @@ class Comment(Base):
|
||||||
over_18 = Column(Boolean, default=False)
|
over_18 = Column(Boolean, default=False)
|
||||||
is_bot = Column(Boolean, default=False)
|
is_bot = Column(Boolean, default=False)
|
||||||
is_pinned = Column(String(25))
|
is_pinned = Column(String(25))
|
||||||
sentto=Column(Integer)
|
sentto=Column(Integer, ForeignKey("users.id"))
|
||||||
notifiedto=Column(Integer)
|
notifiedto=Column(Integer)
|
||||||
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
|
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
|
||||||
oauth_app = relationship("OauthApp", viewonly=True)
|
oauth_app = relationship("OauthApp", viewonly=True)
|
||||||
|
@ -47,6 +47,7 @@ class Comment(Base):
|
||||||
post = relationship("Submission", viewonly=True)
|
post = relationship("Submission", viewonly=True)
|
||||||
flags = relationship("CommentFlag", lazy="dynamic", viewonly=True)
|
flags = relationship("CommentFlag", lazy="dynamic", viewonly=True)
|
||||||
author = relationship("User", primaryjoin="User.id==Comment.author_id")
|
author = relationship("User", primaryjoin="User.id==Comment.author_id")
|
||||||
|
sendtouser = relationship("User", primaryjoin="User.id==Comment.sentto")
|
||||||
parent_comment = relationship("Comment", remote_side=[id], viewonly=True)
|
parent_comment = relationship("Comment", remote_side=[id], viewonly=True)
|
||||||
child_comments = relationship("Comment", remote_side=[parent_comment_id], viewonly=True)
|
child_comments = relationship("Comment", remote_side=[parent_comment_id], viewonly=True)
|
||||||
awards = relationship("AwardRelationship", viewonly=True)
|
awards = relationship("AwardRelationship", viewonly=True)
|
||||||
|
|
|
@ -227,7 +227,6 @@ def message2(v, username):
|
||||||
|
|
||||||
message = request.values.get("message", "")[:1000].strip()
|
message = request.values.get("message", "")[:1000].strip()
|
||||||
|
|
||||||
# check existing
|
|
||||||
existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == v.id,
|
existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == v.id,
|
||||||
Comment.sentto == user.id,
|
Comment.sentto == user.id,
|
||||||
Comment.body == message,
|
Comment.body == message,
|
||||||
|
|
|
@ -175,7 +175,7 @@
|
||||||
{% elif c.author_id==NOTIFICATIONS_ACCOUNT or c.author_id==AUTOJANNY_ACCOUNT %}
|
{% elif c.author_id==NOTIFICATIONS_ACCOUNT or c.author_id==AUTOJANNY_ACCOUNT %}
|
||||||
<span class="font-weight-bold">{{'SITE_NAME' | app_config}} Notification</span>
|
<span class="font-weight-bold">{{'SITE_NAME' | app_config}} Notification</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="font-weight-bold">Private Message</span>
|
<span class="font-weight-bold">Sent to @{{c.senttouser}}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue