forked from rDrama/rDrama
1
0
Fork 0

fix listing bugs

master
justcool393 2022-11-15 03:28:39 -06:00
parent 8f2f48d6d1
commit 4b9c702877
5 changed files with 8 additions and 9 deletions

View File

@ -80,7 +80,6 @@ class Comment(Base):
super().__init__(*args, **kwargs)
def __repr__(self):
return f"<Comment(id={self.id})>"
@lazy

View File

@ -53,7 +53,7 @@ def notifications_modmail(v):
g.db.commit()
if v.client: return {"data":[x.json for x in listing]}
if v.client: return {"data":[x.json(g.db) for x in listing]}
return render_template("notifications.html",
v=v,
@ -123,7 +123,7 @@ def notifications_messages(v):
c.unread = True
list_to_perserve_unread_attribute.append(c)
if v.client: return {"data":[x.json for x in listing]}
if v.client: return {"data":[x.json(g.db) for x in listing]}
return render_template("notifications.html",
v=v,
@ -165,7 +165,7 @@ def notifications_posts(v):
v.last_viewed_post_notifs = int(time.time())
g.db.add(v)
if v.client: return {"data":[x.json for x in listing]}
if v.client: return {"data":[x.json(g.db) for x in listing]}
return render_template("notifications.html",
v=v,
@ -247,7 +247,7 @@ def notifications_reddit(v):
g.db.commit()
if v.client: return {"data":[x.json for x in listing]}
if v.client: return {"data":[x.json(g.db) for x in listing]}
return render_template("notifications.html",
v=v,
@ -318,7 +318,7 @@ def notifications(v):
g.db.commit()
if v.client: return {"data":[x.json for x in listing]}
if v.client: return {"data":[x.json(g.db) for x in listing]}
return render_template("notifications.html",
v=v,

View File

@ -166,7 +166,7 @@ def searchposts(v):
posts = get_posts(ids, v=v, eager=True)
if v.client: return {"total":total, "data":[x.json for x in posts]}
if v.client: return {"total":total, "data":[x.json(g.db) for x in posts]}
return render_template("search.html",
v=v,

View File

@ -400,7 +400,7 @@ def transfers(v):
comments = comments[:PAGE_SIZE]
if v.client:
return {"data": [x.json for x in comments]}
return {"data": [x.json(g.db) for x in comments]}
else:
return render_template("transfers.html", v=v, page=page, comments=comments, standalone=True, next_exists=next_exists)

View File

@ -956,7 +956,7 @@ def get_saves_and_subscribes(v, template, relationship_cls, page:int, standalone
listing = get_comments(ids, v=v)
else:
raise TypeError("Only supports Submissions and Comments. This is probably the result of a bug with *this* function")
if v.client: return {"data": [x.json for x in listing]}
if v.client: return {"data": [x.json(g.db) for x in listing]}
return render_template(template, u=v, v=v, listing=listing, page=page, next_exists=next_exists, standalone=standalone)
@app.get("/@<username>/saved/posts")