forked from rDrama/rDrama
sfd
parent
82e37fb54a
commit
c99dc9d409
|
@ -2,9 +2,9 @@ from files.helpers.wrappers import *
|
||||||
from files.helpers.get import *
|
from files.helpers.get import *
|
||||||
from files.classes import *
|
from files.classes import *
|
||||||
from flask import *
|
from flask import *
|
||||||
from files.__main__ import app, limiter
|
from files.__main__ import app, limiter, cache
|
||||||
from sqlalchemy.orm import joinedload
|
from sqlalchemy.orm import joinedload
|
||||||
|
from .front import frontlist
|
||||||
|
|
||||||
@app.get("/votes")
|
@app.get("/votes")
|
||||||
@auth_desired
|
@auth_desired
|
||||||
|
@ -101,7 +101,6 @@ def api_vote_post(post_id, new, v):
|
||||||
post.stickied = None
|
post.stickied = None
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
cache.delete_memoized(frontlist)
|
cache.delete_memoized(frontlist)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
post.upvotes = g.db.query(Vote.id).options(lazyload('*')).filter_by(submission_id=post.id, vote_type=1).count()
|
post.upvotes = g.db.query(Vote.id).options(lazyload('*')).filter_by(submission_id=post.id, vote_type=1).count()
|
||||||
|
|
Loading…
Reference in New Issue