From ad1a740a6b70ff349b1cb1eb006d4eb8ae5c69d7 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 2 Mar 2020 11:10:53 +0530 Subject: fixed issues --- arduino_blog/decorators.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arduino_blog/decorators.py b/arduino_blog/decorators.py index 2644256..6c185d5 100644 --- a/arduino_blog/decorators.py +++ b/arduino_blog/decorators.py @@ -44,14 +44,12 @@ def is_proposal_submitted(func): ) else: _q = Proposal.objects - _q = _q.filter(Q(user_id=user.id)&Q(proposal_status='0')) - _q = _q.values('proposal_status') - _q = _q.order_by('proposal_status'); - is_sub = _q.all()[:1] - if is_sub == 0: + is_sub = _q.get(Q(user_id=user.id)&Q(proposal_status='0')) + if is_sub.proposal_status == 0: context['success'] = True context['msg'] = "You have alredy submited a \ - proposal" + proposal. Your proposal is under \ + review" return render( request, 'dashboard.html', context ) -- cgit