summaryrefslogtreecommitdiff
path: root/website/views.py
diff options
context:
space:
mode:
authorhardythe12013-11-27 16:33:45 +0530
committerhardythe12013-11-27 16:33:45 +0530
commit382fedbdb2a2f7a97cb5f1eaa1e9f40025ab6e57 (patch)
tree1a58efdc996363979a5bb43f02620acb5779db05 /website/views.py
parentfffd83ebcdef2853006af6aaf29771dea58b44b0 (diff)
downloadSciPy2013-382fedbdb2a2f7a97cb5f1eaa1e9f40025ab6e57.tar.gz
SciPy2013-382fedbdb2a2f7a97cb5f1eaa1e9f40025ab6e57.tar.bz2
SciPy2013-382fedbdb2a2f7a97cb5f1eaa1e9f40025ab6e57.zip
making right access changes for abstracts
Diffstat (limited to 'website/views.py')
-rw-r--r--website/views.py56
1 files changed, 33 insertions, 23 deletions
diff --git a/website/views.py b/website/views.py
index 130556a..cc225bd 100644
--- a/website/views.py
+++ b/website/views.py
@@ -42,38 +42,48 @@ def invited_speakers_page(request):
return render_to_response('invited_speakers.html')
def list_of_abstracts(request):
+ user = request.user
context = {}
+ reviewers = ['jaidevd', 'prabhu', 'jarrod']
papers = Paper.objects.all()
- context['papers'] = papers
- return render_to_response('list_abstracts.html', context)
+ if user.username not in reviewers:
+ context['papers'] = papers
+ return render_to_response('list_abstracts_anonymous.html', context)
+ else:
+ context['papers'] = papers
+ context['user'] = user
+ return render_to_response('list_abstracts.html', context)
def abstract_details(request, paper_id=None):
user = request.user
- reviewers = ['jaidevd', 'prabhu', 'jarrod']
context = {}
- paper = Paper.objects.get(id=paper_id)
- comments = Comment.objects.filter(paper=paper)
- if(len(str(paper.attachments))<=0):
- attachment = False
- else:
- attachment = True
+ reviewers = ['jaidevd', 'prabhu', 'jarrod']
if user.username in reviewers:
context['reviewer'] = True
- context['paper'] = paper
- context['comments'] = comments
- context['attachment'] = attachment
- context['current_user'] = user
- context.update(csrf(request))
- if request.method == 'POST':
- user_comment = request.POST['comment']
- new_comment = Comment()
- new_comment.paper = paper
- new_comment.comment_by = user
- new_comment.comment = user_comment.replace('\n', '<br>')
- new_comment.save()
- return HttpResponseRedirect('/2013/abstract-details/'+paper_id, context)
+ paper = Paper.objects.get(id=paper_id)
+ comments = Comment.objects.filter(paper=paper)
+ if(len(str(paper.attachments))<=0):
+ attachment = False
+ else:
+ attachment = True
+ context['paper'] = paper
+ context['comments'] = comments
+ context['attachment'] = attachment
+ context['current_user'] = user
+ context.update(csrf(request))
+ if request.method == 'POST':
+ user_comment = request.POST['comment']
+ new_comment = Comment()
+ new_comment.paper = paper
+ new_comment.comment_by = user
+ new_comment.comment = user_comment.replace('\n', '<br>')
+ new_comment.save()
+ return HttpResponseRedirect('/2013/abstract-details/'+paper_id, context)
+ else:
+ return render_to_response('abstract_details.html', context)
else:
- return render_to_response('abstract_details.html', context)
+ return render_to_response('not_allowed.html', context)
+
def accepted_abstracts_page(request):