check if Idea is registered with gatekeeper
This commit is contained in:
parent
ca6062f5af
commit
4d1c1ce952
@ -15,7 +15,8 @@ def idea_list(request, slug, ordering='-total_upvotes'):
|
|||||||
ordering_db = {'most_popular': '-score',
|
ordering_db = {'most_popular': '-score',
|
||||||
'latest': '-submit_date'}[ordering]
|
'latest': '-submit_date'}[ordering]
|
||||||
qs = Idea.objects.with_user_vote(request.user).filter(subsite__slug=slug).select_related().order_by(ordering_db)
|
qs = Idea.objects.with_user_vote(request.user).filter(subsite__slug=slug).select_related().order_by(ordering_db)
|
||||||
#print qs
|
if hasattr(qs, '_gatekeeper'):
|
||||||
|
qs = qs.approved()
|
||||||
return list_detail.object_list(request, queryset=qs,
|
return list_detail.object_list(request, queryset=qs,
|
||||||
extra_context={'ordering': ordering, 'subsite':slug}, paginate_by=10,
|
extra_context={'ordering': ordering, 'subsite':slug}, paginate_by=10,
|
||||||
template_object_name='idea')
|
template_object_name='idea')
|
||||||
|
Loading…
Reference in New Issue
Block a user