def author_dashboard(request): direct_submissions = models.Setting.objects.get( group__name='general', name='direct_submissions').value submit_proposals = models.Setting.objects.get( group__name='general', name='submit_proposals').value template = 'author/dashboard.html' context = { 'user_submissions': models.Book.objects.filter( owner=request.user).order_by('-pk').select_related('stage'), 'user_proposals': submission_models.Proposal.objects.filter( owner=request.user).order_by('-pk'), 'user_incomplete_proposals': submission_models.IncompleteProposal.objects.filter( owner=request.user).order_by('-pk'), 'author_tasks': logic.author_tasks(request.user), 'author_task_number': len(logic.author_tasks(request.user)), 'new_messages': logic.check_for_new_messages(request.user), 'direct_submissions': direct_submissions, 'submit_proposals': submit_proposals, } return render(request, template, context)
def author_dashboard(request): template = 'author/dashboard.html' context = { 'user_submissions': models.Book.objects.filter(owner=request.user).select_related('stage'), 'user_proposals': submission_models.Proposal.objects.filter(owner=request.user), 'author_tasks': logic.author_tasks(request.user), 'author_task_number': len(logic.author_tasks(request.user)), 'new_messages': logic.check_for_new_messages(request.user), } return render(request, template, context)
def author_dashboard(request): direct_submissions = models.Setting.objects.get(group__name='general', name='direct_submissions').value submit_proposals = models.Setting.objects.get(group__name='general', name='submit_proposals').value template = 'author/dashboard.html' context = { 'user_submissions': models.Book.objects.filter(owner=request.user).order_by("-pk").select_related('stage'), 'user_proposals': submission_models.Proposal.objects.filter(owner=request.user).order_by("-pk"), 'user_incomplete_proposals': submission_models.IncompleteProposal.objects.filter(owner=request.user).order_by("-pk"), 'author_tasks': logic.author_tasks(request.user), 'author_task_number': len(logic.author_tasks(request.user)), 'new_messages': logic.check_for_new_messages(request.user), 'direct_submissions':direct_submissions, 'submit_proposals': submit_proposals, } return render(request, template, context)
def author_task_count(request): try: return {'author_task_count': len(author_tasks(request.user))} except: return {'author_task_count': 0}