summaryrefslogtreecommitdiff
path: root/arduino_blog
diff options
context:
space:
mode:
authorprashantsinalkar2020-03-02 11:10:53 +0530
committerprashantsinalkar2020-03-02 11:10:53 +0530
commitad1a740a6b70ff349b1cb1eb006d4eb8ae5c69d7 (patch)
treeb9cedf30374fb9a2a3b39ab739b60fc84b26bba1 /arduino_blog
parent398f19633ff99333bd76321dfccdd12c0fd6dbb0 (diff)
downloadarduino_projects_website-ad1a740a6b70ff349b1cb1eb006d4eb8ae5c69d7.tar.gz
arduino_projects_website-ad1a740a6b70ff349b1cb1eb006d4eb8ae5c69d7.tar.bz2
arduino_projects_website-ad1a740a6b70ff349b1cb1eb006d4eb8ae5c69d7.zip
fixed issues
Diffstat (limited to 'arduino_blog')
-rw-r--r--arduino_blog/decorators.py10
1 files 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
)