sfd
This commit is contained in:
parent
cd489bfe0a
commit
5390ce507e
1 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue