Skip to content

Commit

Permalink
removed unnecessary subqueries
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibhas committed Jun 3, 2016
1 parent a2c1dc7 commit 21945cd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions hasjob/views/listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,7 @@ def jobdetail(domain, hashid):
@app.route('/view/<hashid>/related', defaults={'domain': None}, methods=('GET', 'POST'))
def job_related_posts(domain, hashid):
is_siteadmin = lastuser.has_permission('siteadmin')
query = JobPost.query.filter_by(hashid=hashid).options(
db.subqueryload('locations'), db.subqueryload('taglinks'))

post = query.first_or_404()
post = JobPost.query.filter_by(hashid=hashid).options(*JobPost._defercols).first_or_404()

jobpost_ab = session_jobpost_ab()
related_posts = post.related_posts().all()
Expand Down

0 comments on commit 21945cd

Please sign in to comment.