diff options
author | ankitjavalkar | 2015-01-21 11:02:04 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-01-21 11:57:22 +0530 |
commit | 2c5a9183484c9becec86ffab311e22ad52fb6a4c (patch) | |
tree | 9fa04488eb1f262d615a6154a5283bc770068b72 /tbc/views.py | |
parent | ab5eb7840ba1db8f68a512d3c4dfde711b28c8b4 (diff) | |
download | Python-TBC-Interface-2c5a9183484c9becec86ffab311e22ad52fb6a4c.tar.gz Python-TBC-Interface-2c5a9183484c9becec86ffab311e22ad52fb6a4c.tar.bz2 Python-TBC-Interface-2c5a9183484c9becec86ffab311e22ad52fb6a4c.zip |
Pending Proposal notification - fix minor bugs, tooltip formatting
Diffstat (limited to 'tbc/views.py')
-rwxr-xr-x | tbc/views.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tbc/views.py b/tbc/views.py index 6b3e31a..3d981f2 100755 --- a/tbc/views.py +++ b/tbc/views.py @@ -128,18 +128,16 @@ def Home(request): book_images.append(obj) context['items'] = book_images - #Check if user is logged in, Fetch user's pending proposal ID + #Check if user is logged in and fetch user's pending proposal ID if context.get('user'): curr_user = request.user proposal_pos = 0 - user_profile = Profile.objects.get(user=curr_user.id) - pending_proposal = list(Proposal.objects.filter(status="pending")) + user_profile = Profile.objects.filter(user=curr_user) user_proposal = Proposal.objects.filter(user=user_profile) - user_proposal_pending = user_proposal.filter(status="pending")[0] - if user_proposal_pending in pending_proposal: - proposal_position = user_proposal_pending.id - context['proposal_position'] = proposal_position + user_proposal_pending = user_proposal.filter(status="pending") + if user_proposal_pending: + context['proposal_position'] = user_proposal_pending[0].id return render_to_response('base.html', context) |