Exemple #1
0
def subscriptions(request):
	context = initContext(request.user)
    
	if request.user.is_authenticated():
		context["presentation_sub"] = api.getMyPresentationSubscriptions(request.user.id)
		context["thread_sub"] = api.formatComments(api.getMyThreadSubscriptions(request.user.id))
		context["notification"] = api.getNotifications(request.user.id)
		return render(request, 'subscriptions.html', context)
	else:
		context["error_text"] = "You may need to <a href='/'>login</a>."
		return render(request, 'apierror.html', context)
Exemple #2
0
def notifications(request):
	context = initContext(request.user)

	if request.user.is_authenticated():
		context["discussion_notif"] = api.formatComments(api.getDiscussionNotifications(request.user.id))
		context["comment_notif"] = api.getCommentNotifications(request.user.id)
		context["notification"] = api.getNotifications(request.user.id)
	else:
		context["error_text"] = "You may need to <a href='/'>login</a>."
		return render(request, 'apierror.html', context)

	return render(request, 'notifications.html', context)
Exemple #3
0
	def test_normal(self):
		#just checking for errors currently
		comments = api.formatComments(api.getMyComments(USER_ID))